awolarczuk
asked on
iif rs.eof problem from vb6 to vb.net
hey guys i am trying to do a basic if statment in vb.net i am usinf the same as i didnt in vb6 but i am guessing that it is a little different in .net
here is the code i am using
Private Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "select * from [stock_card] where [stockid] = " & stockn.Text
Debug.Print(sql)
If rs.EOF Then
rs.AddNew()
Else
rs.Update()
End If
rs.Open(sql, cnn1, ADODB.CursorTypeEnum.adOpe nDynamic, ADODB.LockTypeEnum.adLockP essimistic )
here is the code i am using
Private Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "select * from [stock_card] where [stockid] = " & stockn.Text
Debug.Print(sql)
If rs.EOF Then
rs.AddNew()
Else
rs.Update()
End If
rs.Open(sql, cnn1, ADODB.CursorTypeEnum.adOpe
That is past (recordsets), you have to use ADO.NET.
Have a look in here http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/ADOPlusOverview.aspx
Have a look in here http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/ADOPlusOverview.aspx
ASKER
yea thnaks huys i know it is the past but it is what i know so i was trying to use it, you know move slowly in the the unknown
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It has a lot of information about how data can be read, represented and written into using ADO .net
If you are lookin for an answer about ur rs.EOF problem, here is a similar discussion going on
http://www.thescripts.com/forum/thread348789.html