473,473 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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?
Nov 20 '05 #1
2 1183
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?

Nov 20 '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
Nov 20 '05 #3

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

Similar topics

3
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...
2
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in...
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...
15
by: JIM.H. | last post by:
Hello, Can I send a dataset as a parameter into stored procedure and import data to a table in the stored procedure? Thanks, Jim.
2
by: Jeff Brown | last post by:
OK i have came to the conclusion that since this app will be run on multiple computers that loading a complete database and then updating on exit is a moot point. I have tried several ideas...
4
by: markerussell | last post by:
I have a question, in that if i have an application is it better to have one dataset per data adapter, ie daCustomerTable -> dsCustomer, daOrders -> dsOrders etc. or to say have a couple of dataset...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
2
by: JT | last post by:
I have an SQL database with one table in it. I want to load the table into a DataSet, add new records to the DataSet, then commit the changes back to the database. Using C#.NET, the following...
3
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.