ExcelDataReader ConfigureDataTable错误

时间:2017-10-26 06:53:04

标签: vb.net exceldatareader

我尝试将.asDataSet()用于配置:

Dim x_config As New ExcelDataSetConfiguration
Dim table_config As New ExcelDataTableConfiguration With {
                                                            .UseHeaderRow = True
                                                         }
x_config.UseColumnDataType = True
x_config.ConfigureDataTable = table_config
'ERROR: Value of type 'ExcelDataTableConfiguration' &_
'cannot be converted to 'Func(Of IExcelDataReader, ExcelDataTableConfiguration)'.

basis_data = reader.AsDataSet(x_config)

我在这里做错了什么?

1 个答案:

答案 0 :(得分:2)

将您的ConfigureDataTable更改为此。

x_config.ConfigureDataTable = Function(tableReader) New ExcelDataTableConfiguration() With {
     .UseHeaderRow = True
    }