Best way to get started?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Folks,

I'm a total ADO.NET newb! I've done some Visual C++.NET and some windows
forms programming but have not done any ADO.NET coding yet. I am writing to
ask what is the best way to get started with a simple Windows Forms ADO.NET
project? Is it possible to build a Windows Form project that can incorporate
ADO functionality? I have MS Visual Studio.NET 2003 but see no option for a
'ADO.NET Project' or maybe I am missing something? All I'm looking to do at
this stage is to connect to a database via a Windows Forms interface and then
take it from there. Any tips or advice on how to get started is much
appreciated!

Many Thanks,

David
 
David,

There is a lot to decide when you use VSNet in advance.

When it is about ADONET is the first decission is if you want go the way of
the designer tools or own written classes. Than you have to choose for by
the designer done strongly typed or non strongly typed.

If you have choosen the last than you can make your own classes, by instance
by inheriting the dataset.

Implementing ADODB if it is not for existing reasons, is in my opinion a bad
choise.

However directly on your question if you do it with the designer.
Open a new empty project
Open in that as item a component
Drag from your toolbox Data an Adapter (which is a wizard).

You have now already a stand alone ADONET class.

I hope this helps,

Cor
 
Hi Cor,

Thnaks very much for your help! I tried out what tuou suggested and I'm
beginning to slowly feel my way around the .NET ADO database connectivity
stuff. I also found this tutorial -

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=633

It seems pretty helpful but some of the code gives errors under MS Visual
..NET 2003 and I had to make a few changes. This tutorial describes how to
connect to a database via a Windows Forms application and update and create
records in the table. However, it gives some errors under .NET 2003. For
example, this line -

this.dbaContacts.Fill(dsMain);

....had to be changed to this line before it worked....

this->mySQLAdapter->Fill(myDataSet);

This will populate all my textfields on my form with the data from the table
in my database. However, these lines give errors -

BindingContext[dsMain, "Contacts"].EndCurrentEdit();
this.dbaContacts.Update(dsMain.Contacts);

These lines are supposed to update the current record being edited. Of
course I can change the last line to -

this->mySQLAdapter->Update(myDataSet->Records);

but I'm not sure how to change the first line??? Any views?

Many Thanks!

David
 
David,

You are looking to C# code and are using C++.

There is an active newsgroup for C++.
However there are AFAIK not much samples.

The newsgroup is
microsoft.public.dotnet.languages.VC

However changing to C# all was it only to learn would be a better option in
my opinion.
BindingContext[dsMain, "Contacts"].EndCurrentEdit();

This row say take from the collection Bindingcontex the table{"Contacts")
from dsMain "Contacts and do with that the procedure EndCurrentEdit() (this
pushes down information from a binded control to the table.

So I assume

BindingContext[dsMain, "Contacts"]->EndCurrentEdit():

However when it is wrong, don't blaim me.

Cor
 
Hi David
I think the best to start with ADO.NET is to use Quickstart
tutorials..try out samples and explore the ADO.NET .......
 
Cor Ligthert said:
David,

You are looking to C# code and are using C++.

Ahh, that will be why then ! :-)
There is an active newsgroup for C++.
However there are AFAIK not much samples.

The newsgroup is
microsoft.public.dotnet.languages.VC
Thanks, I'll check that out!
However changing to C# all was it only to learn would be a better option in
my opinion.
BindingContext[dsMain, "Contacts"].EndCurrentEdit();

This row say take from the collection Bindingcontex the table{"Contacts")
from dsMain "Contacts and do with that the procedure EndCurrentEdit() (this
pushes down information from a binded control to the table.

So I assume

BindingContext[dsMain, "Contacts"]->EndCurrentEdit():

Thanks for the info.!
However when it is wrong, don't blaim me.

Hey ! you got it wrong ;-)

Cheers and thanks for your help,

best,

David
 
Back
Top