raj aryan

raj aryan

  • NA
  • 26
  • 25.6k

ODBC copy to SQL Server

Mar 21 2013 8:16 AM
HI,
I have this C# code with me....
-----------------------------------------------------------------
open the Sql server connection
then
open the Odbc Connection

OdbcCommand sqlCmd = odcon.CreateCommand();
                sqlCmd.CommandText = "" + txtQuery.Text + "";
                OdbcDataReader reader = sqlCmd.ExecuteReader();
                DataTable dt = new DataTable();
                dt.Load(reader);

Now I want to know that how to save the table data row by row to sql server database table. And one more thing 
How to implement the following code,
private void CopyDataTable(DataTable table){ // Create an object variable for the copy. DataTable copyDataTable; copyDataTable = table.Copy(); // Insert code to work with the copy. }
That will copy the data from odbc with the structure to sql server....


Advance Thanks,

Raj