SQLDataAdapter and DataSet Wizards - Confused!!!!!!!

G

Guest

I'm a little confused on what the difference is between creating your
SQLDataAdapter, SQLConnection, and Dataset by code and creating them throught
the Wizard.

When you create these through the wizard, I notice that the Private Sub
InitializeComponent() of the form shows in code all of the attributes and
settings the wizard asked for (stored proc name and parameters, connection
info, blah, blah)

What exactly does having all that code in the InitializeComponent sub do for
me? Does it increase performance?

I noticed that I don't have to actually explicitly open the connection by
using the wizard. In other words there is no need for
Me.SQLConnection1.Open().

I thought that I still have to create a new instance of the DataAdapter,
Connection, Command, and Dataset that the Wizard created for me but that is
not the case.

I can just use me.SQLDataAdapter.Fill(DataSet1) . If this is the case, how
would do I manage my connections?

If you still don't understand my question. Basically I want to know why you
should or shouldn't use the wizard to create SQLDataAdapters, SQL
Connections, SQLCommand and SQL Dataset objects.

The wizards seem too good to be true.
 
C

Cor Ligthert

Softengine,

If you look at your code than you see probably some + signs in front of some
rows.
Click on that, than you see all the code the designer has created for you.

I think that than all your questions in this message are explained. When
not, just reply.

I hope this helps,

Cor
 
G

Guest

Actually, I do see the code when I expand the plus sign but that's what I'm
confused about. Why isn't this code there when I create the adapter,
connection, and dataset manually.
 
C

Cor Ligthert

Softengine,

What VSNet version are you talking about

(The strongly typed Dataset is by the way not in this)

When you have generated that, than you can find in your solution explorer
with the name of the dataset and than as extention classname.vb or cs

You have to set your solution explorer to show all files.

Cor
 
G

Guest

I am using VS.Net 2003 and programming in VB.net.

After a little reading it's a little clearer now.

What codewise makes a dataset a strong typed one? Is it the fact that the
schema is generated during design time?
 
C

Cor Ligthert

Softengine,

When you use the designer, than you have to click right on it and say.
Generate dataset.

That is all you can do with a by the wizard generated dataset.

You can do it as well by hand opening a Dataset Schema, make your tables and
do as well a right click and generate it.

You can create a strongly typed dataset by inheriting dataset

Or you can use a non strongly typed dataset.

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

Top