The source code is as follows: string strConn="the database connection";
SqlConnection Conn=new SqlConnection (strConn);
String strSql="select * from Table";
Try
{
The DataSet ds1=new DataSet ();
Conn. The Open ();
SqlDataAdapter adapter=new SqlDataAdapter (strSql, strConn);
SqlCommandBuilder sqlCB1=new SqlCommandBuilder (adapter);
Adapter. The Fill (ds1);
The foreach (DataRow Dr In ds. Tables [0]. Rows)
{
Dr1 (" ID "SQL]=Dr [r]." Excel ID "ToString ();
,
,
,
Ds1. Tables [0]. Rows. The Add (dr1);
}
Adapter. Update (ds1);
Insert MessageBox. Show (" successful ");
}
CodePudding user response:
Send the wrong section, teenagers, to.net or c # section