I am doing search function and navigate those record into related textboxes....but i can't make it work....since i use to code in VB.net,so i use the method that i was used in vb.net.....here is code that i use but its not work....please help!!!thank you!!
con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Jeff\Documents\Visual Studio 2008\WebSites\WebSite6\App_Data\KindergartenSQL.mdf;Integrated Security=True;User Instance=True"
con.Open()
sql = "SELECT * FROM Login"
da = New SqlDataAdapter(sql, con)
da.Fill(ds, "Login")
con.Close()
maxrows1 = ds.Tables("Login").Rows.Count
inc = 0
con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Jeff\Documents\Visual Studio 2008\WebSites\WebSite6\App_Data\KindergartenSQL.mdf;Integrated Security=True;User Instance=True"
con.Open()
sql = "SELECT * FROM Login"
da = New SqlDataAdapter(sql, con)
da.Fill(ds, "Login")
con.Close()
maxrows1 = ds.Tables("Login").Rows.Count
inc = 0
end sub
Sub navigate1()
Dim ds As New DataSet
Dim inc As Integer
Dim Kindergarten As New DataTable
TextBox1.Text = ds.Tables("Login").Rows(inc).Item(0)
TextBox2.Text = ds.Tables("Login").Rows(inc).Item(1)
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim C As String
Dim c1 As Integer
Dim CustomerFound As Boolean = False
Dim ds As New DataSet
Dim inc As Integer
Dim maxrows1 As Integer
Dim Kindergarten As New DataTable
C = TextBox1.Text
For c1 = 0 To (maxrows1 - 1)
If CStr(ds.Tables("Login").Rows(c1)(0)) = C Then
CustomerFound = True
inc = c1
navigate1()
End If
Next
End Sub