Results 1 to 3 of 3

Thread: [RESOLVED] removing a record from a table using a datagrid control

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    2

    Resolved [RESOLVED] removing a record from a table using a datagrid control

    I am using Visual Studio 2008 to create a Smart Device application.
    I have a form containing a DataGrid (dgShoppingList) which is bound to a BindingSource (TblListItemsBindingSource).
    This BindingSource has a DataSource (DataSetListItems) and this DataSet contains a table (tblListItems).
    I have a button (name: btnDelete) on the form with the following code for its on-click event:

    Dim myRow As String
    myRow = dgShoppingList.CurrentRowIndex
    TblListItemsBindingSource.RemoveAt(myRow)

    My objective is to allow the form user to select a row (record) in the DataGrid and then by clicking on the btnDelete button remove the selected record from the tblListItems table permanently (and consequently remove the row from the DataGrid).

    My code doesn't seem to do the job. It is seemingly removing the item from the DataGrid but not from the table.
    If I carry out a delete operation and close the application, once I reopen the application the previously deleted item is still visable in the DataGrid.
    Can anyone point me in the right direction?
    Many thanks in advance.
    Last edited by tonyblack.co.uk; May 5th, 2009 at 12:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width