Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / May 2005

Tip: Looking for answers? Try searching our database.

Best way to get started?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David++ - 31 May 2005 09:37 GMT
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
Cor Ligthert - 31 May 2005 10:47 GMT
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
David++ - 31 May 2005 13:16 GMT
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,
>
[quoted text clipped - 20 lines]
>
> Cor
Cor Ligthert - 31 May 2005 14:33 GMT
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
David++ - 01 Jun 2005 00:11 GMT
> 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.
[quoted text clipped - 8 lines]
>
> BindingContext[dsMain, "Contacts"]->EndCurrentEdit():

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

Hey ! you got it wrong ;-)

> Cor

Cheers and thanks for your help,

best,

David
HARI PRASD BARU - 01 Jun 2005 00:09 GMT
Hi David
    I think the best to start with ADO.NET is to use Quickstart
tutorials..try out samples and explore the ADO.NET .......

> Hi Folks,
>
[quoted text clipped - 11 lines]
>
> David

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.