G
Guest
Hello,
I am tryin to bind numerous textboxes to the results of my stored procedure.
I cannot get it to work. Is this the righ way to go about it?
....
Try
Cn.Open()
Dim reader5 As SqlDataReader
reader5 = cmdDetails.ExecuteReader()
While reader5.Read
txtName.Text = (reader5.GetString("Name"))
txtLength.Text = (reader5.GetString("Length").ToString)
txtBeds.Text = (reader5.GetInt16("Beds").ToString)
txtTotOnSite.Text = (reader5.GetInt16("No_Onsite").ToString)
txtPrice.Text = (reader5.GetSqlMoney("Cost").ToString)
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
Cn.Close()
End Try
I cannot seem to see the results in my textboxes. I wasnt sure if this was the way to do this as this is normally how i fill a comobox. I just modified the code to suit.
Any help?
I am tryin to bind numerous textboxes to the results of my stored procedure.
I cannot get it to work. Is this the righ way to go about it?
....
Try
Cn.Open()
Dim reader5 As SqlDataReader
reader5 = cmdDetails.ExecuteReader()
While reader5.Read
txtName.Text = (reader5.GetString("Name"))
txtLength.Text = (reader5.GetString("Length").ToString)
txtBeds.Text = (reader5.GetInt16("Beds").ToString)
txtTotOnSite.Text = (reader5.GetInt16("No_Onsite").ToString)
txtPrice.Text = (reader5.GetSqlMoney("Cost").ToString)
End While
Catch ex As Exception
MsgBox(ex.Message)
Finally
Cn.Close()
End Try
I cannot seem to see the results in my textboxes. I wasnt sure if this was the way to do this as this is normally how i fill a comobox. I just modified the code to suit.
Any help?