'How to display data in a grid '---import the ADO Namespaces Imports System.data Imports System.data.SqlClient Public Class frmMain Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load GetMyData() End Sub Private Sub GetMyData() '---define all the pieces and parts IN THIS ORDER!!! Try ' STEP 1 :CONNECTION STRING Dim connString As String = "Data Source=localhost\SQLEXPRESS;Initial Catalog=customers-05;Integrated Security=True" 'STEP 2: CONNECTION OBJECT(uses the connString) Dim Conn As New SqlConnection(connString) 'STEP 3 MAKE SQL STRING(to define which records to get) Dim sqlString As String = "SELECT * from Customers ORDER BY Name" 'STEP 4 DATA ADAPTER (uses our SQL and Conn) Dim dataAdapter As New SqlDataAdapter(sqlString, Conn) 'STEP 5 DATASET(give the dataSet a name that relates to the data you want to display) Dim dataSet As New DataSet 'STEP 6 FILL THE DATA ADAPTER dataAdapter.Fill(dataSet, "customers") 'STEP 7 SET DATAGRID PROPERTIES dgCustomers.DataSource = dataSet dgCustomers.DataMember = "customers" Catch ex As Exception MsgBox("I could not read the database..." & Err.Description, MsgBoxStyle.Critical, "System Message") End Try End Sub