hi frnds,
i had got a problem,,,,,,,
when iam retriving the data from database uising an condition it will shows the data appropriately...
if the conditional value not in the database it will doesnot show any error.......
here iam acessing the data from database using serial number condition,,,,,
if the requested serial number not in the database it doesn't show any error.......
pls help me...
here my coding is given below.........
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles sino.TextChanged, sino.DataBinding
Dim connstr As String
connstr = ConfigurationManager.ConnectionStrings("guest1").ConnectionString()
Dim conn As New SqlConnection(connstr)
Dim dr As SqlDataReader
Dim da As New SqlClient.SqlCommand("select date_of_arr,desig,dept,addr,room_no,no_beds,prior_booking,booked_by from guesthouse where booking_no='" + sino.Text + "' ", conn)
conn.Open()
dr = da.ExecuteReader()
If dr.Read() Then
dateofarrival.Text = dr(0).ToString().Substring(0).Remove(10)
noofbeds.Text = dr(5).ToString
roomno.Text = dr(4).ToString
bookingname.Text = dr(6).ToString
designation.Text = dr(1).ToString
department.Text = dr(2).ToString
address.Text = dr(3).ToString
requestedby.Text = dr(7).ToString
End If
conn.Close()
End Sub
iam using asp.net with vb.net,,
database=sqlserver-2005.....