Hello folks,
I am working on desktop application in c#.net. I have 1 ODBC connection that gives me third party application data into gridview(on 1st button click). Now my task is to dump(export) the data, whatever in the grid, into sqlserver database table(I created the 1 table for sample purpose with the column's name), on 2nd button click. Let me know the procedure in c# to overcome this issue.
here is the code let me know the solution please....
public void export_Click(object sender, EventArgs e)
{
try
{
string connetionString = "sql database connectionstring";
"what to writehere".datasource= model.GetView("Query", txtQuery.Text); //odbc connectionstring
SqlConnection cnn = new SqlConnection(connetionString);
cnn.Open();
string sql = "INSERT Query to get the data from odbc connection and dump the data into sql server database table")";
SqlCommand cmd = new SqlCommand(sql, cnn);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
}
}
Regards,
Raj
Want to export data to the sql server database table
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Satyapriya NayakRank #47 · 31.5K reputationPosted Mar 13, 2013, 2:07 AM EDT
http://www.c-sharpcorner.com/uploadfile/vivek4u_swamy/import-data-from-excel-to-a-sql-server-database/
http://www.c-sharpcorner.com/UploadFile/gnsrinivas1511/import-data-from-sql-server-2005-to-excel-sheet-and-viceversa/