0
OleDbDataAdapter o = new OleDbDataAdapter("select * from tblExam1", conn);
                DataSet ds = new DataSet();
                o.Fill(ds, "tblExam1");
                DataRow r = ds.Tables["tblExam1"].NewRow();
                r["exam1ID"]=324;
                r["patID"] = patid;
                r["ypsos"] = 32;
                ds.Tables["tblExam1"].Rows.Add(r);
                ds.AcceptChanges();

no error message. execute code normally, but row did not inserted in db what i m missing? its access db using from asp.net

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by crishjeny
0

OleDbDataAdapter o = new OleDbDataAdapter("select * from tblExam1", conn);
DataSet ds = new DataSet("tblExam1");
o.Fill(ds, "tblExam1");
DataRow r = ds.Tables["tblExam1"].NewRow();
r["exam1ID"]=324;
r["patID"] = patid;
r["ypsos"] = 32;
ds.Tables["tblExam1"].Rows.Add(r);
r.Update(ds, "tblExam1");
ds.AcceptChanges();


You just forgot the update statement & if possible give name to the dataset as i did....

0

OleDbDataAdapter o = new OleDbDataAdapter("select * from tblExam1", conn);
DataSet ds = new DataSet("tblExam1");
o.Fill(ds, "tblExam1");
DataRow r = ds.Tables["tblExam1"].NewRow();
r["exam1ID"]=324;
r["patID"] = patid;
r["ypsos"] = 32;
ds.Tables["tblExam1"].Rows.Add(r);
r.Update(ds, "tblExam1");
ds.AcceptChanges();


You just forgot the update statement & if possible give name to the dataset as i did....

thanks, its solved by ur help,

1

if it helped you my friend mark it as solved.....

Edited by mith_cool: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.