I am like this to import the table in the DataSet into the database table:
Oconn = new sqlconnection; oconn.open ();
// SRCDS to import DataSet
// DSTable: a table name in SCRDS
// szdasql query statement (SELECT * FROM database table)
public DataSet ImportToDBTable (DataSet srcDS, string szDASQL, string dsTable) {DataSet myDS = new DataSet (); SqlDataAdapter sqlDA = new SqlDataAdapter (szDASQL, oConn); sqlDA.Fill (myDS, dsTable); SqlCommandBuilder sqlcommandbuilder = new SqlCommandBuilder (sqlDA) DataRow mydatarow2 = null; try {for (int J = 0; j
} Myds.tables [dstable] .Rows.add (MyDataRow2); Sqlda.Update (MyDS, DSTABLE);
} Catch {Return Null;} Return MYDS;
}
The method is more stupid, please advise.