Newbie help with Datasets

S

steve

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
 
G

Guest

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.
 
C

Cor Ligthert

Steve,

In addition to Michael, a problem is that mostly(I am not sure if it is
always) the XSD stays in the solution when you remove the pictogram. So when
you remove a dataset, you should remove that as well from the solution
explorer. Sometimes however I do not know in what situation the reference
stays as well in the designer created code, so you have to delete it there.
I do not know if this is by design or that it is a bug.

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top