Thx for the reply Elton
This is what 'm trying to do:-
Tried using one DataAdapter but i still get Error on line:-
PageLinks.Text = PageLinks.Text & dtLinks.Rows(iLoop)("link_url")
Code below
-------------
Dim cmdAccess As New SqlCommand("webpage", dcAccess)
cmdAccess.CommandType = CommandType.StoredProcedure
Dim daTemplate 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
Dim dtPage As DataTable = New DataTable
Dim dtLinksCount As Integer
Dim dtCategoryCount As Integer
dcAccess.Open()
daTemplate.Fill(dsAccess, "templates")
dtTemplate = dsAccess.Tables("templates")
PageHeader.Text =
dtTemplate.Rows(0)("template_header").ToString
PageFooter.Text =
dtTemplate.Rows(0)("template_footer").ToString
daTemplate.Fill(dsAccess, "links")
dtLinks = dsAccess.Tables("links")
dtLinksCount = dtLinks.Rows.Count
PageLinks.Text = ""
Dim iLoop As Integer
iLoop = 0
'Pulls out the category TOP links from the Database by
looping through dtLinks
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.Incre ment(iLoop), iLoop -
1)
End While
daTemplate.Fill(dsAccess, "category")
dtCategory = dsAccess.Tables("category")
dtCategoryCount = dtCategory.Rows.Count
PageCategory.Text = ""
iLoop = 0
While iLoop < dtCategoryCount
PageCategory.Text = PageCategory.Text & "<a href="
PageCategory.Text = PageCategory.Text &
dtCategory.Rows(iLoop)("category_url")
PageCategory.Text = PageCategory.Text & ">"
PageCategory.Text = PageCategory.Text &
dtCategory.Rows(iLoop)("category_text")
PageCategory.Text = PageCategory.Text & "</a><br>"
System.Math.Min(System.Threading.Interlocked.Incre ment(iLoop), iLoop -
1)
End While
'Displaying the Category Headers
'daPage.Fill(dsAccess, "pages")
daTemplate.Fill(dsAccess, "pages")
dtPage = dsAccess.Tables("pages")
PageContent.Text = ""
PageContent.Text = PageContent.Text & "<center><b>"
PageContent.Text = PageContent.Text &
dtPage.Rows(0)("page_title")
PageContent.Text = PageContent.Text & "<br>"
PageContent.Text = PageContent.Text &
dtPage.Rows(0)("page_subtitle")
PageContent.Text = PageContent.Text & "</b><br></center>"
PageContent.Text = PageContent.Text &
dtPage.Rows(0)("page_text")
If Not (Request.QueryString("category") Is Nothing) Then
Dim ssCatPage As String = "Select page_id, page_title,
page_subtitle From pages Where page_category = " &
Request.QueryString("category")
Dim daCatPage As SqlDataAdapter = New
SqlDataAdapter(ssCatPage, dcAccess)
Dim dtCatPage As DataTable = New DataTable
Dim dtCatPageCount As Integer
daCatPage.Fill(dsAccess, "catpages")
dtCatPage = dsAccess.Tables("catpages")
dtCatPageCount = dtCatPage.Rows.Count
iLoop = 0
'Displaying Content in the inner page
While iLoop < dtCatPageCount
PageContent.Text = PageContent.Text & "<p>"
PageContent.Text = PageContent.Text & "<a
href=default.aspx?page="
PageContent.Text = PageContent.Text &
dtCatPage.Rows(iLoop)("page_id")
PageContent.Text = PageContent.Text & ">"
PageContent.Text = PageContent.Text &
dtCatPage.Rows(iLoop)("page_title")
PageContent.Text = PageContent.Text & "</a><br>"
PageContent.Text = PageContent.Text &
dtCatPage.Rows(iLoop)("page_subtitle")
PageContent.Text = PageContent.Text & "</p>"
System.Math.Min(System.Threading.Interlocked.Incre ment(iLoop), iLoop -
1)
End While
End If
*** Sent via Developersdex
http://www.developersdex.com ***