RE: Newbie help with Datasets by howlinghound
howlinghound
Wed Sep 29 22:13:01 CDT 2004
Hi Steve. I've been working with ADO .NET since the VS 2002 beta, and have
used all kinds of datasets. I don't claim to be an expert, but let me see if
I can help.
There are 2 kinds of DataSets, Typed and UnTyped. If you create a Typed
DataSet, you'll see a class type definition listed in the Solution Explorer.
When you add a Typed DataSet to your form, you are creating an instance of
this DataSet. If you delete the instance from your form, the definition of
the Typed DataSet remains on the Solution Explorer and is in fact available
to make a new dataset if you "Create DataSet" from the DataAdapter. Only if
you delete the Typed DataSet from the solution Explorer, will you permanently
remove this DataSet.
As far as relationships in the DataSet, you will need to recreate them
explicitly. It's worthwhile if you're going to create Master-Detail
relationships or if you need to find the child rows from a parent table. I
actually do use these features but far less frequently than using the DataSet
just for storing simple table information.
Hope this helps.
"steve" wrote:
> Hello,
>
> I am new to this and i am experimenting with Datasets and ADO.NET.
> I am trying to go smooth so for now so I created all my Adapters and
> Datasets etc. visually.
> However when i simply delete one of them from the visual panel, under my
> form, and then i create another one with a different name, I see that the
> create-Dataset-wizard list contains as options datasets that were there
> before but (are supposed to) have been deleted !!!???
> Very weird ! Is it a VS 2003 bug?
> Do I have to go to the VB-generated code and delete them internally? I think
> this is probably dangerous....
>
> Also, a dataset is a snapshot of a table(s) which does not contain
> relationship information from the database (?), but the user has to create
> it explicitly with myDataSet.Relations.Add. If this is true and i want to
> Bind (and synchronize) a whole bunch of controls, do i HAVE to recreate the
> relationships explicitly? Then what is the point of accesing a relational
> database?
>
> Thanx for any feedback in advance!
> -steve
>
>
>