Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

string error

when i try to debug my page, some error comes out and it state that "Conversion from string "select tmenu FROM menu where res" to type 'Boolean' is not valid." i don't really know what is the problems here, can somebody figure out for me? thanks

code :

Protected Sub reslist_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myConnection As SqlConnection = New SqlConnection()
myConnection.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ToString()
Dim sqlcon As String
sqlcon = ("select tmenu FROM menu where resname = 'sakura Yeshi'")
Dim myCommand As SqlCommand = New SqlCommand(sqlcon, myConnection)
myConnection.Open()
Dim dr As SqlDataReader = myCommand.ExecuteReader()
If reslist.SelectedValue = ListItem.FromString("sakura").ToString Then

While sqlcon
dr.Read()
Lab.Text = dr("tmenu")

End While
dr.Close()
End If
myConnection.Close()
[1191 byte] By [Zouve] at [2007-11-11 9:55:51]