Link to home
Start Free TrialLog in
Avatar of awolarczuk
awolarczukFlag for Australia

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.adOpenDynamic, ADODB.LockTypeEnum.adLockPessimistic)
Avatar of surajguptha
surajguptha
Flag of United States of America image

Since you are already shifting to VB .net, may i suggest the use of ADO .net? If you are interested how it is done in ADO .net check this link out. http://www.codeproject.com/cs/database/DatabaseAcessWithAdoNet1.asp

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
Avatar of Jorge Paulino
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
Avatar of awolarczuk

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
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial