M
mrajanikrishna
Hi,
I hv a datagrid and WinForm to enter new records.
da = new OleDbDataAdapter("select idno,ename,dob from emp",conn);
da.fill(ds,"emp");
BindGrid();
In the button click(AddNew),
DataTable dt = new ds.Tables["emp"];
DataRow newrow = dt.NewRow();
newrow["idno"]="XXXXXX";
newrow["ename"]="AAAAA";
....
dt.Rows.Add(newrow);
dgEmp.DataSource = ds.getChanges(DataRowState.Added);
dgEmp.DataBind();
Its adding new row. But every click, Its showing the current inserted
row in the datagrid but not previous one. I want to add as many
records as and finally update the datasource.
Whats the problem in my code
I hv a datagrid and WinForm to enter new records.
da = new OleDbDataAdapter("select idno,ename,dob from emp",conn);
da.fill(ds,"emp");
BindGrid();
In the button click(AddNew),
DataTable dt = new ds.Tables["emp"];
DataRow newrow = dt.NewRow();
newrow["idno"]="XXXXXX";
newrow["ename"]="AAAAA";
....
dt.Rows.Add(newrow);
dgEmp.DataSource = ds.getChanges(DataRowState.Added);
dgEmp.DataBind();
Its adding new row. But every click, Its showing the current inserted
row in the datagrid but not previous one. I want to add as many
records as and finally update the datasource.
Whats the problem in my code