Hi All,
iam facing an issue iam able to insert values into my excel file using c# successfully .but when my column name contains "#" ex Target_Group#, iam getting error unknown column name but in my excel the column name is there "Target_Group# ", pls find my insert Query
string query = "INSERT INTO [Sheet2$] ([Target_Group#]) VALUES('OHMCRWP0')";, iam using oledb connections pls help me out on this
Loading

Wim SturkenboomRank #2,527 · 554 reputationPosted Sep 16, 2014, 3:27 AM EDT
string query = "INSERT INTO [Sheet2$] ([\"Target_Group#\"]) VALUES('OHMCRWP0')"
Not sure though.
Ramesh MaruthiRank #937 · 2.2K reputationPosted Sep 16, 2014, 7:45 AM EDT
Errors may occur due to :
Test your database connection in the server explorer make sure it succeeds and then try it. Usually in these scenarios the database connection may not be connected properly.