Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,


Am using oledb to export excel from datatable, i have created a datatable manually and added rows in it and this datatable can be inserted into the excel sheet,but when i use sqladapter to fill the datatable it cannot be done please help.

Refer the code below.
SQL
oledbadap = New OleDb.OleDbDataAdapter()
           oledbadap.InsertCommand = New OleDb.OleDbCommand("INSERT INTO Asciitable([keys],[ascii])values(@keys ,@ascii)", oledcon)
           oledbadap.InsertCommand.Parameters.Add("@keys", OleDbType.Char, 100).Value = "keys"
           oledbadap.InsertCommand.Parameters.Add("@ascii", OleDbType.Char, 50).Value = "ascii"
           oledbadap.Update(dt1, "Asciitable")
Posted
Comments
Richard MacCutchan 10-Dec-14 4:51am    
it cannot be done
You need to edit your question and explain what that is supposed to mean.
Maciej Los 10-Dec-14 11:29am    
when i use sqladapter to fill the datatable it cannot be done
Where do you use sqladapter? I can't see it.
Richard MacCutchan 10-Dec-14 12:12pm    
It's a secret.
Maciej Los 10-Dec-14 12:17pm    
:laugh:
If it's secret, i haven't seen this question and never commented it ;)

1 solution

Please, read my comment to the question.

Whats the difference between manually filled datatable and datable filled by dataadapter?
There is no difference. Datatable is datatable and nothing else.
 
Share this answer
 

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