hey frens,
i have a datagridview and number of textboxes showing the value in the datgridrow clicked.
now what i wan tis whenever change in textboxes or gridview happens, they must change their values accordingly.
i m unable to update database:
my code goes like this:
OleDbConnection con = new OleDbConnection(@"provider= Microsoft.Jet.OLEDb.4.0; Data Source = D:\My Documents\Visual Studio 2005\Projects\db2.mdb");
con.Open();
OleDbDataAdapter thisadapter1 = new OleDbDataAdapter("Select * from tbl_client where fname= '" + fname + "'", con);
OleDbCommandBuilder cd = new OleDbCommandBuilder(thisadapter1);
DataSet ds = new DataSet();
OleDbCommandBuilder builder= new OleDbCommandBuilder(thisadapter1);
thisadapter1.Fill(ds, "tbl_client");
OleDbCommandBuilder mycommand = new OleDbCommandBuilder(thisadapter1);
int i = thisadapter1.Update(ds, "tbl_client");
if (i > 0)
{
MessageBox.Show("database updated");
}
else
{
MessageBox.Show("no updates");
}
con.Close();
thanks in advance
Radhika
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).