in my form i have a datagrid
for inserting a row in a datagrid i use the following code
dim da as new sqldataadapter("select * from tab",cn)
dim x as new sqlcommnadbuilder(da)
da.insertcommnad=x.getinsertcommand()
da.update(ds,"t")
it is working fine
also i wrote code for updating
just replace updatecommand with insert command
it is also working fine
now my query is i want to delete a row from data grids using sqlcommandbuilder
i tried like this
dim da as new sqldataadapter("select * from tab",cn)
dim x as new sqlcommnadbuilder(da)
da.deletecommnad=x.getdeletecommand()
da.update(ds,"t")
but the row is not getting deleted
what r the modifications needed
thk u
for inserting a row in a datagrid i use the following code
dim da as new sqldataadapter("select * from tab",cn)
dim x as new sqlcommnadbuilder(da)
da.insertcommnad=x.getinsertcommand()
da.update(ds,"t")
it is working fine
also i wrote code for updating
just replace updatecommand with insert command
it is also working fine
now my query is i want to delete a row from data grids using sqlcommandbuilder
i tried like this
dim da as new sqldataadapter("select * from tab",cn)
dim x as new sqlcommnadbuilder(da)
da.deletecommnad=x.getdeletecommand()
da.update(ds,"t")
but the row is not getting deleted
what r the modifications needed
thk u