• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 966
  • Last Modified:

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)
0
awolarczuk
Asked:
awolarczuk
  • 2
1 Solution
 
surajgupthaCommented:
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
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
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
0
 
awolarczukAuthor Commented:
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
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
>> know move slowly in the the unknown

Thats correct, but you advance in the right direction. Is not so difficult to chance and you will find later more easy and with more advantages.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now