J
Jim Lawton
I've puzzled over my c# book and examples on the web, but i cannot see what the
logic of this is. Sorry this is such a gash bit of code, but the question is, I
have inserted a row in to the dataset. Now I want to get that update applied to
the actual table, but I don't want to parameterise the data or anything like
that, cos I've already inserted it. All I want is the row I created in the real
table.
Similar problems will apply to amended rows - lets say I select certain rows,
update them all in the dataset, then want to write them *all* back. No
parameters no selection.
TIA, Jim
OdbcConnection con = new OdbcConnection("DRIVER={MySQL ODBC 3.51
Driver};Server=localhost;Database=mySQL;Uid=***;Pwd=**;option=3");
OdbcCommand selcmd = new OdbcCommand("SELECT * FROM TEST1", con);
OdbcCommand inscmd=newOdbcCommand(????????????????????????);
OdbcDataAdapter da = new OdbcDataAdapter(selcmd);
da.InsertCommand = inscmd;
DataSet ds = new DataSet();
da.Fill(ds,"TEST1");
DataRow row = ds.Tables[0].NewRow();
row[0] = "newdeal";
ds.Tables[0].Rows.Add(row);
da.Update(ds,"TEST1");
logic of this is. Sorry this is such a gash bit of code, but the question is, I
have inserted a row in to the dataset. Now I want to get that update applied to
the actual table, but I don't want to parameterise the data or anything like
that, cos I've already inserted it. All I want is the row I created in the real
table.
Similar problems will apply to amended rows - lets say I select certain rows,
update them all in the dataset, then want to write them *all* back. No
parameters no selection.
TIA, Jim
OdbcConnection con = new OdbcConnection("DRIVER={MySQL ODBC 3.51
Driver};Server=localhost;Database=mySQL;Uid=***;Pwd=**;option=3");
OdbcCommand selcmd = new OdbcCommand("SELECT * FROM TEST1", con);
OdbcCommand inscmd=newOdbcCommand(????????????????????????);
OdbcDataAdapter da = new OdbcDataAdapter(selcmd);
da.InsertCommand = inscmd;
DataSet ds = new DataSet();
da.Fill(ds,"TEST1");
DataRow row = ds.Tables[0].NewRow();
row[0] = "newdeal";
ds.Tables[0].Rows.Add(row);
da.Update(ds,"TEST1");