PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET App.config string <> strongly typed ds

Reply

App.config string <> strongly typed ds

 
Thread Tools Rate Thread
Old 06-02-2006, 10:49 AM   #1
=?Utf-8?B?Tmlja2w=?=
Guest
 
Posts: n/a
Default App.config string <> strongly typed ds


I would like to use strongly typed datasets (I think), but find the following
limitation; When configuring the Dataadpter with the wizard (VS2003) a
connection object is generated for me. I want to use a connection object
based on a string in the App.Config file, but when I attempt to do this by
modifying the generated code, I lose my ability to generate a dataset.

Can I have my global connection string, and generate (typed) Dataadapters +
datasets from the toolbox, or will I have to code my own?

If I do have to code my own, can anyone give some links to some good
examples of how to do it?

I am leaning towards strong typing, but am happy to be persuaded away if
that gives me the flexibility I need.

Any help appreciated
Nick
  Reply With Quote
Old 10-02-2006, 04:56 PM   #2
Mateus Padovani Velloso
Guest
 
Posts: n/a
Default Re: App.config string <> strongly typed ds

Yes, you can.

Just right-click at solution explorer and choose to create a new dataset. It
will generate a XSD file, to where you can drag your tables.
Now you have your typed dataset, and can use it anywhere you want.

Using typed DataSets does not limit you of using bussines classes,
centralized connection string or anything.

"Nickl" <Nickl@discussions.microsoft.com> wrote in message
news:33168B53-7CB7-49F1-BAAF-D1EAA48E6B1E@microsoft.com...
>I would like to use strongly typed datasets (I think), but find the
>following
> limitation; When configuring the Dataadpter with the wizard (VS2003) a
> connection object is generated for me. I want to use a connection object
> based on a string in the App.Config file, but when I attempt to do this by
> modifying the generated code, I lose my ability to generate a dataset.
>
> Can I have my global connection string, and generate (typed) Dataadapters
> +
> datasets from the toolbox, or will I have to code my own?
>
> If I do have to code my own, can anyone give some links to some good
> examples of how to do it?
>
> I am leaning towards strong typing, but am happy to be persuaded away if
> that gives me the flexibility I need.
>
> Any help appreciated
> Nick



  Reply With Quote
Old 22-02-2006, 10:16 AM   #3
=?Utf-8?B?Tmlja2w=?=
Guest
 
Posts: n/a
Default Re: App.config string <> strongly typed ds

Thanks Mateus,
That has worked perfectly. I now generate all my datasets manually, and I
enjoy the control.
Cheers


"Mateus Padovani Velloso" wrote:

> Yes, you can.
>
> Just right-click at solution explorer and choose to create a new dataset. It
> will generate a XSD file, to where you can drag your tables.
> Now you have your typed dataset, and can use it anywhere you want.
>
> Using typed DataSets does not limit you of using bussines classes,
> centralized connection string or anything.
>
> "Nickl" <Nickl@discussions.microsoft.com> wrote in message
> news:33168B53-7CB7-49F1-BAAF-D1EAA48E6B1E@microsoft.com...
> >I would like to use strongly typed datasets (I think), but find the
> >following
> > limitation; When configuring the Dataadpter with the wizard (VS2003) a
> > connection object is generated for me. I want to use a connection object
> > based on a string in the App.Config file, but when I attempt to do this by
> > modifying the generated code, I lose my ability to generate a dataset.
> >
> > Can I have my global connection string, and generate (typed) Dataadapters
> > +
> > datasets from the toolbox, or will I have to code my own?
> >
> > If I do have to code my own, can anyone give some links to some good
> > examples of how to do it?
> >
> > I am leaning towards strong typing, but am happy to be persuaded away if
> > that gives me the flexibility I need.
> >
> > Any help appreciated
> > Nick

>
>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off