Why don't you insert some break points and cycle through your code using F10 or F11 and tell us which part your getting the error.
arjunsasidharan
Practically a Posting Shark
826 posts since Aug 2006
Reputation Points: 347
Solved Threads: 13
what did you declare inc as? Did you try my suggestion as which line your getting the error?.
Show us which part of the line your getting error?
arjunsasidharan
Practically a Posting Shark
826 posts since Aug 2006
Reputation Points: 347
Solved Threads: 13
Try using the databindings in the textbox
Textbox1.DataBindings.Add("Text", ds.Address1, "rollno")
arjunsasidharan
Practically a Posting Shark
826 posts since Aug 2006
Reputation Points: 347
Solved Threads: 13
after doing this it shows messages
"address1 is not the member of system.data.dataset "
sorry that wouldn't have worked
Well i can only give you suggestions
Try retrieveing the data in a Sqldatareader
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'conn.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\AddressBook.mdb"
connstr1 = "server=kishorjagtap;uid=sa;pwd=kishor;database=addressbook"
Dim conn As New SqlConnection(connstr1)
Dim sql As String
sql = "Select * from address1"
conn.Open()
Dim cmd As New SqlCommand(sql, conn)
dim drSql as SqlDataReader
drsql = cmd.ExecuteReader
If drSql.Read() then
TextBox1.Text = drSql.Item("rollno").ToString()
TextBox2.Text = drSql.Item("name").ToString()
End IF
Dim ds As New DataSet()
da = New SqlDataAdapter(sql, conn)
da.Fill(ds, "Address1")
maxrows = ds.Tables("Address1").Rows.Count
inc = -1
conn.Close()
End Sub
Don't know whether it will work.. Just try it out.
arjunsasidharan
Practically a Posting Shark
826 posts since Aug 2006
Reputation Points: 347
Solved Threads: 13