Hi,
Will that be possible to add a data to a database by using dataSet ??
Thanks
Printable View
Hi,
Will that be possible to add a data to a database by using dataSet ??
Thanks
in conjunction with the updater obj (dataAdapter)
hm... do you mind posting some code ?? been google them out, but can not find any...
Thanks pirate
This saves the data in two columns "IDNumber and Name" and update the database . I assume you know how to create proper connection string that uses MS Access as backend.
Code:CONN.OpnConnection();
string SQLStr ="SELECT * FROM TableXXX";
OleDbDataAdapter MyAdapter =new OleDbDataAdapter (SQLStr,CONN);
OleDbCommandBuilder builder =new OleDbCommandBuilder (MyAdapter);
DataSet mydataset =new DataSet() ;
MyAdapter.Fill(mydataset,"TableXXX");
DataRow MyDataRow =mydataset.Tables["TableXXX"].NewRow();
MyDataRow["IDNumber"]="55820"
MyDataRow["Name"]="John";
.........
........
mydataset.Tables["TableXXX"].Rows.Add(MyDataRow);
MyAdapter.Update(mydataset,"TableXXX");
MessageBox.Show("Data Saved into TableXXX", "Saved");
CONN.ClosConnection();