DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links