Deleting a row in DataGrid from database (help!)

bizjosh

Member
Joined
Mar 16, 2005
Messages
23
Programming Experience
Beginner
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

Codes:

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

kulrom

Well-known member
Joined
May 10, 2005
Messages
2,854
Location
Republic of Macedonia
Programming Experience
10+
Hi,
Why you don't try this 14 days evaluation application that generate SQL Statements for you ... very easy for use ;)

So, use it while this make you more comfordable to make SQL Statements by yourself ... later you could uninstall it from your PC ;)
http://www.gold-software.com/EazySQL-review20410.htm

Cheers ;)
 
Last edited:

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
You can also use MS Access and Visual Studio (the query builder) to generate the SQL statements. Visual studio also has a Data Form Wizard that will generate a form, dataset schema, and code for you based on a series of questions. You can then look at the code/SQL statements and learn.
 
Top Bottom