473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataSet Question

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
pa********@pariahware.com
Pariahware, Inc. Custom Software and Shareware
http://www.pariahware.com
--
God loved you so much that He gave His only son Jesus.
What have you done with God's gift?
Jul 21 '05 #1
2 1254
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

"Christian Miller" <pa********@pariahware.com> wrote in message
news:pa******************************@news1-ge0.southeast.rr.com...
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
pa********@pariahware.com
Pariahware, Inc. Custom Software and Shareware
http://www.pariahware.com
--
God loved you so much that He gave His only son Jesus.
What have you done with God's gift?

Jul 21 '05 #2
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
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dennis | last post by:
I was wondering...Is there a way that a DataSet can be kept available throughout an entire session. I don’t want to keep having to re-query the database for the same data. If it is possible can...
2
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
0
by: Mike | last post by:
Hi, I am trying to solve a problem with a DataSet issue I am having. In my app the user selects certain options and based on those options it goes out to the db to get data based on those...
2
by: Tommy Lang | last post by:
I am creating a database application that uses the dataset. The dataset holds three different tables. I can access each table, no problem there. But how can I combine data from the different...
1
by: Avon | last post by:
Hi there, I am very sorry for my not perfect English. I've got very simple question. Is it possible to have stored procedure with 2 result tables and then from my application to refer to this...
13
by: Lars Netzel | last post by:
I'm trying to copy data from two tables in a Source db into two Tables in a Destination db and the Tables designa are the same. I created 4 adapters... 2 for the two tables in the source db...
2
by: Rich Wallace | last post by:
I know datasets have been beaten to death in here, I have what is hopefully a simple question about the integrity of a dataset when used in an application. Scenario: User A and User B are...
4
by: Robert Bravery | last post by:
Hi All, I'm New to VS.net. Trying to figure out this new dataset thingy. Ok so I add a dataadapter with all the correct properties for a table. Then generate the dataset. Now open the dataset and...
6
by: Joseph | last post by:
Is it possible to create a dataset in one form of a Win app and use that same dataset in a second form of the same app? If so, how? Thanks.
5
by: Franck | last post by:
how come unchanged always true even if data changed This code come from my saving button: ============================================ DataSet ds1 = new DataSet(); DataSet ds2 = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.