Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Guys,

I have a problem that I couldn't find the solution.

The user enter some values into the textboxes and then those data is going to send to an excel file.

My INSERT statement is like this:

(Note : I use OLEDB Provider)

C#
string data = "INSERT INTO [Sheet1$](A1) VALUES ('value')"


The error is A1 couldn't be found.

Awaiting answers.

Thanks

Haluk
Posted
Updated 5-Oct-12 1:36am
v2
Comments
[no name] 5-Oct-12 7:33am    
Try [Sheet1$]

1 solution

Dont use sheet name. create header and use headers name
.
http://csharp.net-informations.com/excel/csharp-excel-oledb-insert.htm[^]
 
Share this answer
 
Comments
haluk_78 5-Oct-12 7:53am    
I know this way...

I can update the values according to headers name.
What if the headers are not as column?. This is because some of my values are as row so how I am gonna update values.
Dain Ucak 5-Oct-12 8:54am    
and this is about update
http://csharp.net-informations.com/excel/csharp-excel-oledb-update.htm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900