6
Answers

I wrote a code to export my data in gridview to excel

Kacey Ezerioha

Kacey Ezerioha

12y
5.3k
1
Hi,
I wrote a code to export my data in gridview to excel. But at runtime it throws an exception saying "syntax error in INSERT TO" on execution of the command. I stepped through the code to see the output of the sql statement and I see nothing wrong with it. Can anyone assist me quickly on this please? Very many thanks in advance.


NB: The table creates perfectly, but the INSERT statement gives the exception.


I attached my source code here for your perusal.

Attachment: my source code.rar

Answers (6)
0
Roei Bar

Roei Bar

NA 7.8k 0 15y
use Page.Request.UserHostAddress;
Accepted
0
Ken Barrett

Ken Barrett

NA 173 0 15y
Ok, stupid me... this seems to work.

String hostName = System.Net.Dns.GetHostName();
lblIpAdr.Text = hostName ;