I hope someone can help me figure out this problem I have tried many things. I am using Visual Studio 2003 and have SQL 2000 loaded my local system. Below is the the sample code that I have been trying to get to work. I am new a programming so I will try not to ask to many stupid questions. Here is the code that I was testing to see if I could pull a dataset into a form. I am doing some sample so that I can understand the SQL connection for a project that I am working on.
' Imports Data and SqlClient namespaces...
Public Class Form1
Dim myConnection As SqlConnection = New _
Dim myDataAdapter As New SqlDataAdapter
Dim myDataSet As DataSet = New DataSet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Set the SelectCommand properties...
myDataAdapter.SelectCommand = New SqlCommand
myDataAdapter.SelectCommand.Connection = myConnection
myDataAdapter.SelectCommand.CommandText = _
"SELECT au_lname, au_fname, title, price " & _
"FROM authors " & _
"JOIN titleauthor ON authors.au_id = titleauthor.au_id " & _
"JOIN titles ON titleauthor.title_id = titles.title_id " & _
"ORDER BY au_lname, aufname"
myDataAdapter.SelectCommand.CommandType = CommandType.Text
'Open the database connection...
'Now execute the command...
'Fill the DataSet object with data...
myDataAdapter.Fill(myDataSet, "authors") ' <<< Receive the error message here "An unhandled exception of type 'System.Data.SqlClient.SqlException'
' occurred in system.data.dll"?
'Close the database connection...
'Set the DataGrid properties to bind it to our data...
grdAuthorTitles.DataSource = myDataSet
grdAuthorTitles.DataMember = "authors"