Deleting a row in DataGrid from database (help!)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Deleting a row in DataGrid from database (help!)

  1. #1
    Join Date
    Apr 2005
    Posts
    17

    Deleting a row in DataGrid from database (help!)

    Deleting a row in DataGrid from database (help!)
    -

    I'm using a Oledatadapter to fill a dataset and displaying
    my ms access records via a datagrid. Anybody is familiar on how to

    1. Allow a user to select a Datagrid row and click on a button
    "btnDelete" the row will be deleted from the database?
    Each row has a unique column called 'ID'. any help?

    2. How to write codes to delete all the records that has
    integer value of "1" in its Column: fld_Type

    Binding Codes:

    dataview = dataset.Tables("Table").DefaultView
    datagrid.datasource = dataview

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    For the grid , have the event SelectedIndexChanged handled by a method where you will set the rows by 1

    In the button click event
    Just remove all the rows from the datatable of the dataset , then accept changes on the dataset and then dataadapter.update()

    Should do the job

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center