G
Gary
I have two grids on a form. Contacts and Notes. For
each contact there can be many notes.
When I click on a contact (which is bound to the contact
table) I want to fill the notes grid and I use the
following code:
Dim cmdstring As String = "Select [date], [time],
endtime, [desc], con_id from Notes where con_id = '" &
Label3.Text & "'"
Dim da As New SqlClient.SqlDataAdapter
Dim ds As New DataSet
Dim daNotes1 As New SqlClient.SqlDataAdapter
(cmdstring, Me.SqlConnection2)
daNotes1.Fill(ds, "Notes")
Me.DG_Notes.DataSource = daNotes1
Me.DG_Notes.DataMember = "Notes"
But when I run the code I get an "unhandled error" on the
daNotes1.Fill line.
I took the cmdstring and put it into SQL Enterprise
manager and ran the query. Data was returned. Why is
this not filling the grid?
Any help would be appreciated.
Thanks
Gary
each contact there can be many notes.
When I click on a contact (which is bound to the contact
table) I want to fill the notes grid and I use the
following code:
Dim cmdstring As String = "Select [date], [time],
endtime, [desc], con_id from Notes where con_id = '" &
Label3.Text & "'"
Dim da As New SqlClient.SqlDataAdapter
Dim ds As New DataSet
Dim daNotes1 As New SqlClient.SqlDataAdapter
(cmdstring, Me.SqlConnection2)
daNotes1.Fill(ds, "Notes")
Me.DG_Notes.DataSource = daNotes1
Me.DG_Notes.DataMember = "Notes"
But when I run the code I get an "unhandled error" on the
daNotes1.Fill line.
I took the cmdstring and put it into SQL Enterprise
manager and ran the query. Data was returned. Why is
this not filling the grid?
Any help would be appreciated.
Thanks
Gary