Link to home
Start Free TrialLog in
Avatar of flooz
flooz

asked on

How do I write data into a DataGridView

I have created a database (dbsCustomer) in MS SQL Studio Express. There is a table (tblCustomers) which I want to display in VB, using a DataGridView. I am using Visual Studio 2005.

I have 3 classes in my VB.
(1)libDataAccessLayer (for reading data from the DBMS); I have added the database as a Data Source in this layer.

(2)libBusinessLayer (which gets the data from libDataAccessLayer)
and

(3)Display, holds a form to display the data in the DataGridView).

I just could not load anything in the DataGridView. Can anyone see if I have done anything wrong, or have I left something out?

I have attached a .doc file containing the codes that were used. There are coding for libAccessLayer, libBusinessLayer and Display; as well as the SQL statements for the database

Thanks!
Codings.doc
ASKER CERTIFIED SOLUTION
Avatar of Jorge Sanchez
Jorge Sanchez
Flag of Ecuador image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chuno
Chuno

Set the Datasource property on the Datagridview on the Form page and modify what you would like in the GUI editor.  In the code behind fill the datasource for the page using Fill in the Load Function.

Me.MyDataAdaptor.Fill(Me.DataSet1.MyTable)