I have managed to connect to a remote server DB and retriev a record using SqlDataAdapter.SelectCommand and putting the result into a DataSet.
Now i want to update a table. The code appears to run through with no exceptions, but the DB never shows an update.
Here is the code:
How can i find what the problem is? Is there some value i can read from the DataAdapter to find out what happened?
SD
Now i want to update a table. The code appears to run through with no exceptions, but the DB never shows an update.
Here is the code:
Code:
string s_conn="[connection string]";
SqlConnection oConn = new SqlConnection(s_conn);
oConn.Open ();
SqlCommand oCmd;
oCmd = new SqlCommand ("INSERT into Names(Title,Name) VALUES ('Mr','Bloggs')");
oCmd.Connection=oConn;
// Update the data using the DataAdaptor
SqlDataAdapter oDA = new SqlDataAdapter();
oDA.UpdateCommand = oCmd;
How can i find what the problem is? Is there some value i can read from the DataAdapter to find out what happened?
SD