Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32096

ODBC copy to SQL Server

$
0
0
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

Viewing all articles
Browse latest Browse all 32096

Trending Articles