Click here to Skip to main content
11,584,208 members (58,204 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0
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)

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

The error is A1 couldn't be found.

Awaiting answers.

Thanks

Haluk
Posted 5-Oct-12 1:30am
Edited 5-Oct-12 1:36am
v2
Comments
Wes Aday at 5-Oct-12 7:33am
   
Try [Sheet1$]

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Dont use sheet name. create header and use headers name
.
http://csharp.net-informations.com/excel/csharp-excel-oledb-insert.htm[^]
  Permalink  
Comments
haluk_78 at 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 at 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)

  Print Answers RSS
0 OriginalGriff 430
1 Sergey Alexandrovich Kryukov 329
2 Dave Kreskowiak 240
3 Richard Deeming 220
4 virusstorm 194
0 OriginalGriff 1,663
1 Sergey Alexandrovich Kryukov 1,229
2 Abhinav S 701
3 Dave Kreskowiak 667
4 Suvendu Shekhar Giri 568


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100