Loop through the records in a table using a dataset

For each loop through data set

Reference:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim myDS As DataSet

Dim theSql As String

theSql = "SELECT * FROM Projects WHERE isSlideshow = 1 ORDER BY TypeID, Sequence"

myDS = SqlHelper.ExecuteDataset(App.SQLConn(), CommandType.Text, theSql, Nothing)

For Each Row As DataRow In myDS.Tables(0).Rows

Dim myPanel As New OboutInc.Show.Panel

Dim myShortDesc As New LabelmyShortDesc.Text = Row(

"ShortDesc")

Dim myImage As New ImagemyImage.ImageUrl =

"/images/Projects/" & Row("Photo")

Dim myCity As New LabelmyCity.Text = Row(

"City")

Dim theDetailsLink As New HyperLink

theDetailsLink.Text = "View Details"

theDetailsLink.NavigateUrl = "/Projects.aspx?ID=" & Row("ID")

myPanel.Controls.Add(myShortDesc)

myPanel.Controls.Add(myImage)

myPanel.Controls.Add(myCity)

myPanel.Controls.Add(theDetailsLink)

obShow.AddPanel(myPanel)

Next

End Sub


 

 
Maint