CODE
OleDbConnection mySqlConn = new OleDbConnection(SqlConnString);
OleDbCommand mySqlCom = mySqlConn.CreateCommand();
OleDbConnection mySqlConn2 = new OleDbConnection(Sql2ConnString);
OleDbCommand mySqlCom2 = mySqlConn2.CreateCommand();
mySqlCom.CommandText = "SELECT * FROM OISInt_Contact";
OleDbDataAdapter mySqlAd = new OleDbDataAdapter();
mySqlAd.SelectCommand = mySqlCom;
DataSet myDS = new DataSet();
mySqlConn.Open();
mySqlAd.Fill(myDS, "OISInt_Contact");
mySqlCom2.CommandText = "SELECT * FROM OISInt_Contact";
OleDbDataAdapter mySqlAd2 = new OleDbDataAdapter();
mySqlAd2.SelectCommand = mySqlCom2;
DataSet myDS2 = new DataSet();
mySqlConn2.Open();
mySqlAd2.Fill(myDS2, "OISInt_Contact");
mySqlConn.Close();
mySqlConn2.Close();
myDS2.Merge(myDS, true, MissingSchemaAction.AddWithKey);
foreach (DataTable dt in myDS2.Tables)
{
foreach (DataRow dr in dt.Rows)
{
foreach (DataColumn dc in dt.Columns)
{
}
}
}
mySqlAd2.SelectCommand.Connection = mySqlConn2;
mySqlAd2.InsertCommand = new OleDbCommand(String.Format("OISInt_ContactInsert", myDS.Tables));
mySqlAd2.InsertCommand.CommandType = CommandType.StoredProcedure;
mySqlAd2.Update(myDS2, "OISInt_Contact");
when I do a step into all data is in the data set and it merges but goes not commit or accept changes to the database I trying to move it to.
This post has been edited by shelby poston: 15 Oct, 2008 - 06:50 AM