eramgarden
Contributor
- Joined
- Mar 8, 2004
- Messages
- 579
I have a sql that returns 3 rows..i want each row assigned to a different label:
This is what I have:
cmd.CommandText = "Select label from lmaster where label_group ='Generic' and s_id= " & "'" & Session("Mode") & "'"
cnn.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
Do While dr.Read()
btnContact.Text = dr.GetString(0)
btnSite.Text = dr.GetString(0)
btnIncident.Text = dr.GetString(0)
Loop
The way I have it, it assigns the first row to ALL 3 lables, then assign the second row to ALL 3 lables, then assigns the 3rd row to ALL 3 lables..
an ideas on how to do this?
This is what I have:
cmd.CommandText = "Select label from lmaster where label_group ='Generic' and s_id= " & "'" & Session("Mode") & "'"
cnn.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
Do While dr.Read()
btnContact.Text = dr.GetString(0)
btnSite.Text = dr.GetString(0)
btnIncident.Text = dr.GetString(0)
Loop
The way I have it, it assigns the first row to ALL 3 lables, then assign the second row to ALL 3 lables, then assigns the 3rd row to ALL 3 lables..
an ideas on how to do this?