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 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
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
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 > > >
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Steven Blair |
last post by:
Hi,
Quick overview of the problem:
public bool Something( out DataSet ds )
{
bool ret=false;
try
{
|
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...
|
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...
|
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...
|
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...
|
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....
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
| |