Imports System.Data.SqlClient
Public Class Form1
Inherits System.Windows.Forms.Form
'Create ADO.NET objects.
Private myConn As SqlConnection
Private myCmd As SqlCommand
Private myReader As SqlDataReader
Private results As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Create a Connection object.
myConn = New SqlConnection("Data Source=LAURENCE-NB\sqlexpress;Initial Catalog=insourcenet;Integrated Security=True")
'Open the connection.
myConn.Open()
'Create a Command object.
myCmd = myConn.CreateCommand
myCmd.CommandText = "SELECT * from custinfo" '(or any other info I may select)
'The line below will populate the DataGrid but with all info and I want the ability to select the info to fill from the 'SELECT' command above.
'My datagrid name is DataDridView1
CustinfoTableAdapter.Fill(InsourcenetDataSet.custinfo)
End Sub
End Class