|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataGrid How to delete underlying databaseI have a datagrid bound to a database and
I would like to be able to select a row programmable and then delete it. I have been trying to use the OleDbDataAdapter1.DeleteCommand but I can't figure out the syntax. DataGrid1.Select(DataGrid1.CurrentRowIndex) OleDbDataAdapter1.DeleteCommand ??????????? First of all: You're using the oledb dataadapter, so the delete syntax
depends on the underlying database you use. The DeleteCommand is used within the dataadapter.Update method. I think you cannot use it all alone (but I'm not quite sure). So, the simplest way for you is to use the dataadapter wizard of Visual Studio that will create you all of the commands used to. After that, you can manually delete the row in your datasource (a datatable normalliy) and the make a dataadapter.update. Daniel Show quoteHide quote "Tom McL." wrote: > I have a datagrid bound to a database and > I would like to be able to select a row > programmable and then delete it. > I have been trying to use the OleDbDataAdapter1.DeleteCommand > but I can't figure out the syntax. > > DataGrid1.Select(DataGrid1.CurrentRowIndex) > OleDbDataAdapter1.DeleteCommand ??????????? > > > >
Mixing VB variables with standard text to output text file
Refresh DataSet - please Help Me :-( foxpro table hosed up when called 2nd time from VB.net Creating array on the fly as a parameter to a subroutine? OT: ILMerge Polymorphic XML Serialized Array Line Numbers in RichTextBox.. SaveFileDialog how to convert... Storing multiple text files inone file. |
|||||||||||||||||||||||