I don't want to drag something on my form I want to open a recordset programmatically and move back and forth through it. I would like to make a connection to a SQL database on my WEB site, then open a table or recordset with a select statement then be able to movefirst or movenext through that recordset and also be able to extract the columns data textbox = somefieldname.
I seem to get a lot of code written only to find out a data reader can't movelast or movenext or this can't use a field name or something. driving me nuts!
here is my vs2005 code so far
DougP
< I Built one
I seem to get a lot of code written only to find out a data reader can't movelast or movenext or this can't use a field name or something. driving me nuts!
here is my vs2005 code so far
Code:
Dim conn As SqlConnection
Dim da As SqlDataAdapter = New SqlDataAdapter()
Dim cmd As SqlCommand
conn = New SqlConnection
conn.ConnectionString = "server=000.000.000.000;uid=user;pwd=pass;database=myDB"
cmd = New SqlCommand("Select * from [TimeSheet Employees]", conn)
da.SelectCommand = cmd
Dim custDS As DataSet = New DataSet
da.Fill(custDS, "Select * from [TimeSheet Employees]")
'move to first record
'or move to last record
'or read all records one at a time
'be able to move back to first record
me.txtName = da????? ("Name")
me.txtAddress = da????? ( "Address")
'etc
conn = Nothing
da = Nothing
cmd = Nothing
DougP
< I Built one