944,054 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 310
  • ASP.NET RSS
Nov 3rd, 2009
0

regarding searching the sqldatabase using asp

Expand Post »
here i have to search the database according to serial no and show the information of that serial no
the problem here everything is fine and
  Dim a As String
        Dim b As Boolean
        Dim dr As SqlDataReader
        Dim ConnStr As String
        ConnStr = ConfigurationManager.ConnectionStrings("gate").ConnectionString()
        Dim conn As New SqlConnection(ConnStr)

        conn.Open()
        Dim command As New SqlCommand("select * from visitors_pass", conn)
        dr = command.ExecuteReader
        b = False

        a = Integer.Parse(TextBox1.Text)
        While dr.Read()
            If (a = dr(0)) Then
                default4.label2.text = dr(0)
                default4.label4.text = dr(1)
                b = True
                dr.Close()
                conn.Close()
                Response.Redirect("default4.aspx")

                Exit While
            End If
        End While
        MsgBox("enter the numeric value")
        TextBox1.Focus()
        b = True



        If (b = False) Then
            MsgBox("no data matching to this serial number is found")

        End If
        dr.Dispose()
        conn.Dispose()
        dr.Close()
        conn.Close()
        TextBox1.Text = ""

    End Sub
the error is it is saying that default4 is not declared even i created it
if that is not the correct one then what is the correct one, plz help me thanks
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
mshravs is offline Offline
75 posts
since May 2009
Nov 4th, 2009
0
Re: regarding searching the sqldatabase using asp
plz any tell me whether the code is correct or not. i need it urgently plz help me
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
mshravs is offline Offline
75 posts
since May 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Contact form
Next Thread in ASP.NET Forum Timeline: databinding one webform with another





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC