当前位置: 动力学知识库 > 问答 > 编程问答 >

updating data in EXCEL using ado.net , how to refer to columns in sql statement?

问题描述:

I am connecting to the excel file using ADO.NET OLeDB drivers.

In the connection string I have HDR=NO ( which means my excel file does not have header)

I want to run update statement and refer to column as they are in excel file.

The below sql query throws the following error : No value given for one or more required parameters.

update [fact$] set AC='test123' where DO='xxxyyy'

Here 'AC' and 'DO' are the respective columns on excel sheet 'fact'.

网友答案:

As far as my quick research has found, the Jet engine assigns columns names starting with F, i.e. F1, F2, F3 etc.

You can do your own testing by creating an OleDataReader, then calling the GetSchemaTable() method to find out about your columns.

分享给朋友:
您可能感兴趣的文章:
随机阅读: