Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO.NET best practice? 1

Status
Not open for further replies.

EricdlH

Programmer
Nov 21, 2001
8
GB
I am new to ADO.NET and was wading my way through connections, data adapters and datasets when an experienced programmer said just use this:

Dim rsobj As New ADODB.Recordset()
rsobj.Open("select * bla, bla", gdbNTBs, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly)

Do While Not rsobj.EOF
list.Add(New NTBMediaType(rsobj.Fields("comment").Value,_
rsobj.Fields("mediatypeid").Value))
rsobj.MoveNext()
Loop
rsobj.Close()

My question is: is this antequated or clever?
 
Antiquated.
It is not using ADO.NET. ADO and ADO.NET are very different. What you would consider a recordset would pretty much now be a Dataset. Think of an ADO recordset as a thinned down version of a dataset. Although a dataset is focused on the disconnected side of cursors. You can store data from multiple tables in the same or different databases and create relationships from them. This particular programmer that offered you the advice, may focus his experience on ADO and VB6.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top