Try This One:-
(SqlConnection cn = new SqlConnection
ConfigurationManager.ConnectionStrings["ConnectionName"].ConnectionString);
cn.Open();
SqlBulkCopy copy = new SqlBulkCopy(cn);
copy.DestinationTableName = "Table Name";
//Dt Is DataTable
copy.WriteToServer(dt);
(SqlConnection cn = new SqlConnection
ConfigurationManager.ConnectionStrings["ConnectionName"].ConnectionString);
cn.Open();
SqlBulkCopy copy = new SqlBulkCopy(cn);
copy.DestinationTableName = "Table Name";
//Dt Is DataTable
copy.WriteToServer(dt);
No comments:
Post a Comment