Datagrid-Data access

Phiber_Optik

New member
Joined
Aug 18, 2006
Messages
4
Programming Experience
Beginner
How do I read records from dataset when i specify the primary key in the datagrid field
 
? are you asking how to databind to a datagrid?

I need a little more info.
 
Datagrid HELP!!!

Im creating a project for billing (cash memo) purpose.The design is in such a way that i have a datagrid in a windows form.When the cashier ie. user enters a unique product id, the product details should be displayed in the corresponding fields of the record.
How do I implement the above?
 
Are you going to allow the user to edit that record as well? If not then use the dataReader object. It is much faster but be careful as its read-forward only.

Else if you want the user to submit changes, setup a dataTable and dataAdapter with a Command object that executes an SQL query.

i.e "SELECT * FROM tablename WHERE id=" & productID (the one entered by user)

Then bind your dataGrid into to the dataTable.

VB.NET:
DataGrid1.DataSource = dataTable.DefaultView
 
Back
Top