DataSet Question

  • Thread starter Thread starter Christian Miller
  • Start date Start date
C

Christian Miller

Hello. I am trying to follow some VB.net code and am having a heck of a
time trying to figure out a dataset source. I am assuming that a
dataset is similar to an adodb.recordset in VB6.

Here is the line of code that I am looking at:
mydataview = New DataView(mydatasource.Tables(0))

I need to know how to find the query that is being used to fill
mydataview. I'm well versed in vb6 and this .net conversion is driving
me crazy. In vb6, if I had a recordset, I could just print the
".source" and obtain the query. Please tell me that there is something
equivalent. Any help would be greatly appreciated.



Thanks,
Christian
(e-mail address removed)
Pariahware, Inc. Custom Software and Shareware
http://www.pariahware.com
 
NO.

DataSet is a disconnected data cache.

It is something like the ADO Disconnected RecordSet in this regard.

Typically you fill the DataSet with a DataAdapter, and that is where the
Select statement is contained.
(In the SelectCommand, I believe).

-D
 
Hi Christian,

A dataset is a collection of datatables the last looks more like recordsets.
The difference between those last two is that a datatable is disconnected
while a recordset is connected.

To fill a dataset you need to use the designer or to make it in code using:
a connection (either SqlClient or OleDB for not SQLserver ann Oracle)
a dataset itself
a dataadapter

very simple written here (however complete) it is
dim conn as new sqlclient.sqlconnection("connection string")
dim ds as new dataset
dim da as new sqlclient.sqldataadapter("select * from mytable",conn)
da.fill(ds)

When you want to sort it you can use a dataview, which is a filter and
usable as a datasource

dim dv as new dataview(ds.tables(0))
dv.sort = "myfield"

I hope this helps a little bit?

Cor
 
Back
Top