ADO conversion to ADO.net

sradel

Member
Joined
Aug 4, 2005
Messages
10
Programming Experience
1-3
I have a very good simple example on using ADO that I found on the internet by Beacon. But I believe it was for ADO not ADO.net so I am trying to convert it. There is one line that I am having problems with.

rs.Open "tbl_master", cn, adOpenKeyset, adLockPessimistic, adCmdTable

I have converted it to this for ADO.net

rs.Open("Hands", cn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockPessimistic, adCmdTable)

But I can not find what the command for what adCmdTable should be in .net.

Any help would be great.
thanks

 
If you want it to behave in ADO.NET manner actually you don't need these recordset options at all.
Althrough, i am not sure i beleive that adCmdTable in this case means that you want to retrieve all rows from the table that is obsolete in ADO.NET.

In ADO.NET all you need is to query the SQL statement then just open the connection and execute the reader ... finally close the conn. Voila! Or if you follow dataset you just need to fill the dataset from the data adapter.
Ask if you need concrete example (btw, try to find some threads where you can find some demos how to manage data with ADO.NET) ;)
 
If you want to use ADO.NET then don't even consider ADO. Starting with ADO and converting it is a bad idea. Just decide what you want to accomplish and then determine how best to do so in ADO.NET. Check out the ADO.NET tutorial links in my signature, courtesy of TechGnome.
 
Sorry, I don't have those links in my signature here. That's at another forum where the signature length limit is a little more generous. :( Do a member search for TechGnome and get them from his sig.
 
That would be me..... links are in my sig below...

-tg
 
Back
Top