J
Jim Mesara
I have the following bit of code. What it does it query the database for
address information, and there can be multiple addresses for each person.
For
each person, the repeater creates a row. Each repeater row can display as
many addresses as are needed (usually one, but it can be more.)
For Each strTemp In strArray
objAdp = New OleDbDataAdapter(strSQL, objConn)
objAdp.Fill(objDS, strTemp)
Next
Response.Write("<br>Table count = " & objDS.Tables.Count)
If objDS.Tables.Count > 1 Then
'Bind as normal
Repeater1.DataSource = objDS.Tables()
Else
'Only bind the single table
Repeater1.DataSource = objDS.Tables(0)
End If
Repeater1.DataBind()
If I enter two people, each with one address, the repeater displays
correctly and the code works fine. If I enter one person with multiple
addresses, I get the following error:
Error: Cannot find table 1
So it looks like the code above thinks that there is another table in the
objDS, but the Response.Write for the query causing the problem says the
table count is 1. So I'm not sure why the Repeater control is trying to bind
more than one table. All the addresses associated with the person display
properly. The error occurs after the addresses have been displayed properly.
Any ideas why the code would think there is an extra table?
Thank you for you help,
Jim
address information, and there can be multiple addresses for each person.
For
each person, the repeater creates a row. Each repeater row can display as
many addresses as are needed (usually one, but it can be more.)
For Each strTemp In strArray
objAdp = New OleDbDataAdapter(strSQL, objConn)
objAdp.Fill(objDS, strTemp)
Next
Response.Write("<br>Table count = " & objDS.Tables.Count)
If objDS.Tables.Count > 1 Then
'Bind as normal
Repeater1.DataSource = objDS.Tables()
Else
'Only bind the single table
Repeater1.DataSource = objDS.Tables(0)
End If
Repeater1.DataBind()
If I enter two people, each with one address, the repeater displays
correctly and the code works fine. If I enter one person with multiple
addresses, I get the following error:
Error: Cannot find table 1
So it looks like the code above thinks that there is another table in the
objDS, but the Response.Write for the query causing the problem says the
table count is 1. So I'm not sure why the Repeater control is trying to bind
more than one table. All the addresses associated with the person display
properly. The error occurs after the addresses have been displayed properly.
Any ideas why the code would think there is an extra table?
Thank you for you help,
Jim