multi-fill dataset. Only one SqlDataAdapter.Fill(dataset)
call will fill multi-tables in the dataset.
>-----Original Message-----
>I have a simple Stored Procedure with multiple select
statements..doing
>select * from links for example.
>I created a DataTable and then fill the tables
>But the first dtTemplate DataTable doesn't give the error
but the links
>does!
>I get the error on this LINE(when looping):-
>
>PageLinks.Text = PageLinks.Text & dtLinks.Rows(iLoop)
("link_url")
>
>
>cmdAccess.CommandType = CommandType.StoredProcedure
>cmdAccess.CommandText = "mystocprocedure"
>
> Dim daTemplate As SqlDataAdapter = New SqlDataAdapter
(cmdAccess)
> Dim daLinks As SqlDataAdapter = New
>SqlDataAdapter(cmdAccess)
> Dim daCategory As SqlDataAdapter = New
>SqlDataAdapter(cmdAccess)
>
> Dim dsAccess As DataSet = New DataSet
> Dim dtTemplate As DataTable = New DataTable
> Dim dtLinks As DataTable = New DataTable
> Dim dtCategory As DataTable = New DataTable
> 'filling DataSet with links table
> daLinks.Fill(dsAccess, "links")
> dtLinks = dsAccess.Tables("links")
>
> dtLinksCount = dtLinks.Rows.Count
> PageLinks.Text = ""
>
>While iLoop < dtLinksCount
> PageLinks.Text = PageLinks.Text & "<a
href="
> PageLinks.Text = PageLinks.Text &
>dtLinks.Rows(iLoop)("link_url")
> PageLinks.Text = PageLinks.Text & ">"
> PageLinks.Text = PageLinks.Text &
>dtLinks.Rows(iLoop)("link_text")
> PageLinks.Text = PageLinks.Text & "</a>"
>
> If iLoop < dtLinksCount - 1 Then
> PageLinks.Text = PageLinks.Text & "
| "
> End If
>
>
>System.Math.Min(System.Threading.Interlocked.Increment
(iLoop), iLoop -
>1)
>
> End While
>
>Any ideas?
>
>*** Sent via Developersdex
http://www.developersdex.com ***
>.