473,387 Members | 1,495 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,387 software developers and data experts.

Another Dataset question

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 drag another table from the
server explorer, set up some relations there. Set up two grids, one a s a
parent one as a chgild. Fill the dataset, run the form
But my child grid never gets any records.

I then added another datadapter for the child tabel, regenerated the
dataset, resetup the relatiosn. Now it works

Do I have to have a datadapter for each table that I am working with. If
this is so, why allow the user to drag and drop a table onto the dataset.

Covert your answers

Thanks
Robert

Jan 13 '06 #1
4 1416
Hi,

"Robert Bravery" <me@u.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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 drag another table from the
server explorer, set up some relations there. Set up two grids, one a s a
parent one as a chgild. Fill the dataset, run the form
But my child grid never gets any records.

I then added another datadapter for the child tabel, regenerated the
dataset, resetup the relatiosn. Now it works

Do I have to have a datadapter for each table that I am working with.
Yes. That is if you want to store to and load from a DB.
If this is so, why allow the user to drag and drop a table onto the
dataset.

There is a difference between a typed DataTable and a DataAdapter. A typed
DataTable is 'configured' inside a DataSet schema, from there code is
generated for the typed DataSet class and the typed DataTable classes, then
the typed DataSet/DataTable's can be instantiated from code or with the
Designer.

A DataAdapter on the other hand is just a class like any other, it can't be
configured inside a DataSet schema, it can only be instantiated and
configured at runtime from code or from designer.

Hence dragging a Table from Server Explorer into a Typed DataSet, doesn't
create a DataAdapter, where would it need to create one ? on Form1, on
Form2, in some code file ? No you need to create your own DataAdapter
where you need it, you could create it with the Designer on a Form or within
code (if you need the same on different forms).

In 1.1 the DataAdapter (on a Form) can however be used to generate a typed
DataSet. The simpliest steps for a master-child are to drag the two tables
from Server Explorer onto the Form, this should create two DataAdapters,
then right-click on the Form and choose "Generate DataSet", make sure both
tables are checked and click ok. Then you could open the typed dataset in
schema designer to check if there is a relation (and add one if there
isn't).

All this is one of the important changes in Net2.0, in Net2.0 there are
TableAdapters, they are similar to DataAdapters except that now they are
generated classes that are also configured inside the DataSet schema, just
like typed DataTable's.
HTH,
Greetings

Covert your answers

Thanks
Robert

Jan 13 '06 #2
Hi Bart,
thanks for the explanation.
So if I understand correctly. The same datasetcan be used on many different
forms as long as there are the correct dataadapters on each form. Is this
correct

Thanks
Robert

"Bart Mermuys" <bm*************@hotmail.com> wrote in message
news:e6**************@tk2msftngp13.phx.gbl...
Hi,

"Robert Bravery" <me@u.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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 drag another table from the server explorer, set up some relations there. Set up two grids, one a s a parent one as a chgild. Fill the dataset, run the form
But my child grid never gets any records.

I then added another datadapter for the child tabel, regenerated the
dataset, resetup the relatiosn. Now it works

Do I have to have a datadapter for each table that I am working with.
Yes. That is if you want to store to and load from a DB.
If this is so, why allow the user to drag and drop a table onto the
dataset.


There is a difference between a typed DataTable and a DataAdapter. A

typed DataTable is 'configured' inside a DataSet schema, from there code is
generated for the typed DataSet class and the typed DataTable classes, then the typed DataSet/DataTable's can be instantiated from code or with the
Designer.

A DataAdapter on the other hand is just a class like any other, it can't be configured inside a DataSet schema, it can only be instantiated and
configured at runtime from code or from designer.

Hence dragging a Table from Server Explorer into a Typed DataSet, doesn't
create a DataAdapter, where would it need to create one ? on Form1, on
Form2, in some code file ? No you need to create your own DataAdapter
where you need it, you could create it with the Designer on a Form or within code (if you need the same on different forms).

In 1.1 the DataAdapter (on a Form) can however be used to generate a typed
DataSet. The simpliest steps for a master-child are to drag the two tables from Server Explorer onto the Form, this should create two DataAdapters,
then right-click on the Form and choose "Generate DataSet", make sure both
tables are checked and click ok. Then you could open the typed dataset in
schema designer to check if there is a relation (and add one if there
isn't).

All this is one of the important changes in Net2.0, in Net2.0 there are
TableAdapters, they are similar to DataAdapters except that now they are
generated classes that are also configured inside the DataSet schema, just
like typed DataTable's.
HTH,
Greetings

Covert your answers

Thanks
Robert


Jan 13 '06 #3
Hi,

"Robert Bravery" <me@u.com> wrote in message
news:e3**************@TK2MSFTNGP14.phx.gbl...
Hi Bart,
thanks for the explanation.
So if I understand correctly. The same datasetcan be used on many
different
forms as long as there are the correct dataadapters on each form. Is this
correct
To be more precise each Form can have an instance of the same typed DataSet,
yes. Keep in mind that each Form will have its own instance, so the data
isn't shared between Forms this way. You can create as many instances of
the typed DataSet as you want (whether this is in code or on Forms) .

And yes, you'll need to have a correct DataAdapter on each Form. So if you
have multiple Form's that need the same DataAdapter then you could consider
doing the DataAdapter configuration from a code file, class or module and
then use that instead of placing the same DataAdapter on multiple Forms.
Greetings,
HTH

Thanks
Robert

"Bart Mermuys" <bm*************@hotmail.com> wrote in message
news:e6**************@tk2msftngp13.phx.gbl...
Hi,

"Robert Bravery" <me@u.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
> 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 drag another table from the > server explorer, set up some relations there. Set up two grids, one a s a > parent one as a chgild. Fill the dataset, run the form
> But my child grid never gets any records.
>
> I then added another datadapter for the child tabel, regenerated the
> dataset, resetup the relatiosn. Now it works
>
> Do I have to have a datadapter for each table that I am working with.


Yes. That is if you want to store to and load from a DB.
>If this is so, why allow the user to drag and drop a table onto the
>dataset.
>


There is a difference between a typed DataTable and a DataAdapter. A

typed
DataTable is 'configured' inside a DataSet schema, from there code is
generated for the typed DataSet class and the typed DataTable classes,

then
the typed DataSet/DataTable's can be instantiated from code or with the
Designer.

A DataAdapter on the other hand is just a class like any other, it can't

be
configured inside a DataSet schema, it can only be instantiated and
configured at runtime from code or from designer.

Hence dragging a Table from Server Explorer into a Typed DataSet, doesn't
create a DataAdapter, where would it need to create one ? on Form1, on
Form2, in some code file ? No you need to create your own DataAdapter
where you need it, you could create it with the Designer on a Form or

within
code (if you need the same on different forms).

In 1.1 the DataAdapter (on a Form) can however be used to generate a
typed
DataSet. The simpliest steps for a master-child are to drag the two

tables
from Server Explorer onto the Form, this should create two DataAdapters,
then right-click on the Form and choose "Generate DataSet", make sure
both
tables are checked and click ok. Then you could open the typed dataset
in
schema designer to check if there is a relation (and add one if there
isn't).

All this is one of the important changes in Net2.0, in Net2.0 there are
TableAdapters, they are similar to DataAdapters except that now they are
generated classes that are also configured inside the DataSet schema,
just
like typed DataTable's.
HTH,
Greetings

> Covert your answers
>
> Thanks
> Robert
>
>
>



Jan 13 '06 #4
HI,
Ok now that makes more sense. I would have to learn how to do this tho.
Moving from one language to another is rather difficult.

Robert
And yes, you'll need to have a correct DataAdapter on each Form. So if you have multiple Form's that need the same DataAdapter then you could consider doing the DataAdapter configuration from a code file, class or module and
then use that instead of placing the same DataAdapter on multiple Forms.

Jan 13 '06 #5

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

Similar topics

10
by: Steven Blair | last post by:
Hi, Quick overview of the problem: public bool Something( out DataSet ds ) { bool ret=false; try {
3
by: JJ | last post by:
Hi, I need to pass a dataset to another win form along with a SqldataAdapter. I don't want to recreate the SqlDataAdapter again either. So to pass to another Win form in my windows form app, do...
2
by: a | last post by:
NEW Post Here's my best guess at how to insert this dataset.... the code runs, but no new records are added to the sql table. I've read and split a delimited text file into a dataset. It...
2
by: Sam | last post by:
Hi ther First off, sorry for this long post, but I think it is needed to explain my proble I have this dataset I am working with named dsMyDataset I am trying to add data to the dataset/ access...
1
by: hcs | last post by:
Hello, on a datagrid when you alter the dataset and want to show the new dataset you use datagrid.refresh(). how is this possible on a form which is based on a dataset and consists of a number...
6
by: chreo | last post by:
Sorry for weird title and sorry for my English (I'm from Poland). This is the problem: I have form with many controls. There are three comboboxes - each should have table STREETS as DataSource....
4
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new...
4
by: RipperT | last post by:
College newbie here (Instructor MIA). I have instructions to pass variable values from one web page to another like this (VS2005): 1. Declare and create the properties on the first page (source...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.