hi i want to show the message box using database conditions,,,,,
here my coding is given below.........
Protected Sub roomno_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles roomno.SelectedIndexChanged
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("guest1").ConnectionString())
Try
conn.Open()
Dim dr As System.Data.SqlClient.SqlDataReader
Dim da As New SqlClient.SqlCommand("select room_no from guesthouse WHERE room_no = '" & roomno.SelectedItem.Text & "' and status <> 'C'", conn)
dr = da.ExecuteReader
While dr.Read()
MsgBox("this room is booked from " & dr(0).ToString().Substring(0).Remove(10) & " to " & dr(1).ToString().Substring(0).Remove(10) & ".so this room is available from the date " & dr(1).ToString().Substring(0).Remove(10) & " onwards! ")
End While
Catch ex As Exception
conn.Close()
End Try
End Sub
here the problem is not showing any message........
pls help me........
give me the correct coding........
pls help me urgent..........