PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET How do I generate a data adapter for a typed dataset?

Reply

How do I generate a data adapter for a typed dataset?

 
Thread Tools Rate Thread
Old 21-05-2004, 07:56 PM   #1
Ken Varn
Guest
 
Posts: n/a
Default How do I generate a data adapter for a typed dataset?


I have a typed DataSet in which I would like to generate a matching
DataAdapter. I tried using oleDBCommandBuilder class, but it does not seem
to create any table or column mappings. Is there someway to automatically
generate a DataAdapter that is matched up to a typed DataSet with all of the
table and column mappings built automatically from the typed DataSet?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------


  Reply With Quote
Old 21-05-2004, 09:31 PM   #2
William Ryan eMVP
Guest
 
Posts: n/a
Default Re: How do I generate a data adapter for a typed dataset?

The commandBuilder infers its logic from the select statement and I don't
believe there's any issue with using it with a typed dataset. You match the
CB to an Adapter and the mapping is done for you if the there's a select
statement and the table has a key. CommandBuilders are a bit lame though so
if you may want to use the DataAdapterConfiguration wizard or preferably you
can roll your own update logic. If you do this you'll have a lot better
control over concurrency and you can fine tune your update.

Bill Vaughn has a great article on this at www.betav.com ->Articles ->
MSDN ->Weaning developers from the commandbuilder.

Good luck,

Bill

--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
"Ken Varn" <nospam> wrote in message
news:Os4oU01PEHA.556@tk2msftngp13.phx.gbl...
> I have a typed DataSet in which I would like to generate a matching
> DataAdapter. I tried using oleDBCommandBuilder class, but it does not

seem
> to create any table or column mappings. Is there someway to automatically
> generate a DataAdapter that is matched up to a typed DataSet with all of

the
> table and column mappings built automatically from the typed DataSet?
>
> --
> -----------------------------------
> Ken Varn
> Senior Software Engineer
> Diebold Inc.
>
> EmailID = varnk
> Domain = Diebold.com
> -----------------------------------
>
>



  Reply With Quote
Old 21-05-2004, 09:37 PM   #3
Ken Varn
Guest
 
Posts: n/a
Default Re: How do I generate a data adapter for a typed dataset?

I looked into using the DataAdapterConfiguration wizard, but you can only
access it when you are putting a DataAdapter onto a form. Is there anyway
to get to the wizard outside of the form editor in VS.NET?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:u8IxLm2PEHA.556@TK2MSFTNGP10.phx.gbl...
> The commandBuilder infers its logic from the select statement and I don't
> believe there's any issue with using it with a typed dataset. You match

the
> CB to an Adapter and the mapping is done for you if the there's a select
> statement and the table has a key. CommandBuilders are a bit lame though

so
> if you may want to use the DataAdapterConfiguration wizard or preferably

you
> can roll your own update logic. If you do this you'll have a lot better
> control over concurrency and you can fine tune your update.
>
> Bill Vaughn has a great article on this at www.betav.com ->Articles ->
> MSDN ->Weaning developers from the commandbuilder.
>
> Good luck,
>
> Bill
>
> --
>
> W.G. Ryan, eMVP
>
> http://forums.devbuzz.com/
> http://www.knowdotnet.com/williamryan.html
> http://www.msmvps.com/WilliamRyan/
> "Ken Varn" <nospam> wrote in message
> news:Os4oU01PEHA.556@tk2msftngp13.phx.gbl...
> > I have a typed DataSet in which I would like to generate a matching
> > DataAdapter. I tried using oleDBCommandBuilder class, but it does not

> seem
> > to create any table or column mappings. Is there someway to

automatically
> > generate a DataAdapter that is matched up to a typed DataSet with all of

> the
> > table and column mappings built automatically from the typed DataSet?
> >
> > --
> > -----------------------------------
> > Ken Varn
> > Senior Software Engineer
> > Diebold Inc.
> >
> > EmailID = varnk
> > Domain = Diebold.com
> > -----------------------------------
> >
> >

>
>



  Reply With Quote
Old 21-05-2004, 10:30 PM   #4
William Ryan eMVP
Guest
 
Posts: n/a
Default Re: How do I generate a data adapter for a typed dataset?

As stated you are correct, the wizard only works via the designer. If you
don't want to use the designer and aren't into commandbuilders or the method
Bill mentions at the link I sent you before , you can use a Template to
accomplish what you want, check out Miha Markic's site
http://www.rthand.com/Default.aspx?Page=2&SubPage=1 under the Generate Save
Adapter.

As an aside, it almost sounds like you are looking for an ORM tool if you
want something to automatically generate your data access logic... you may
want to take a loot at www.deklarit.com and/or LLBLGenPro, both of which
kick a33. We have a discussion forum on ORM here
http://forums.devbuzz.com/Using_OR%...rumid_28/tt.htm

Also. you may notice I mention Kathleen Dollard's new book on Code
Generation. She discusses this topic and ORM in Chapter 6 and it's a really
well done discussion.

Code generation is very cool and using templates like Miha illustrates is
another really neat technique. Even if you decide that it's not for you, I
think you'll be glad you looked into it if you check out his stuff,
Deklarit's product or Frans' stuff and/or Kathleen's book.
--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
"Ken Varn" <nospam> wrote in message
news:e$Erss2PEHA.2132@TK2MSFTNGP11.phx.gbl...
> I looked into using the DataAdapterConfiguration wizard, but you can only
> access it when you are putting a DataAdapter onto a form. Is there anyway
> to get to the wizard outside of the form editor in VS.NET?
>
> --
> -----------------------------------
> Ken Varn
> Senior Software Engineer
> Diebold Inc.
>
> EmailID = varnk
> Domain = Diebold.com
> -----------------------------------
> "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> news:u8IxLm2PEHA.556@TK2MSFTNGP10.phx.gbl...
> > The commandBuilder infers its logic from the select statement and I

don't
> > believe there's any issue with using it with a typed dataset. You match

> the
> > CB to an Adapter and the mapping is done for you if the there's a select
> > statement and the table has a key. CommandBuilders are a bit lame

though
> so
> > if you may want to use the DataAdapterConfiguration wizard or preferably

> you
> > can roll your own update logic. If you do this you'll have a lot better
> > control over concurrency and you can fine tune your update.
> >
> > Bill Vaughn has a great article on this at www.betav.com ->Articles ->
> > MSDN ->Weaning developers from the commandbuilder.
> >
> > Good luck,
> >
> > Bill
> >
> > --
> >
> > W.G. Ryan, eMVP
> >
> > http://forums.devbuzz.com/
> > http://www.knowdotnet.com/williamryan.html
> > http://www.msmvps.com/WilliamRyan/
> > "Ken Varn" <nospam> wrote in message
> > news:Os4oU01PEHA.556@tk2msftngp13.phx.gbl...
> > > I have a typed DataSet in which I would like to generate a matching
> > > DataAdapter. I tried using oleDBCommandBuilder class, but it does not

> > seem
> > > to create any table or column mappings. Is there someway to

> automatically
> > > generate a DataAdapter that is matched up to a typed DataSet with all

of
> > the
> > > table and column mappings built automatically from the typed DataSet?
> > >
> > > --
> > > -----------------------------------
> > > Ken Varn
> > > Senior Software Engineer
> > > Diebold Inc.
> > >
> > > EmailID = varnk
> > > Domain = Diebold.com
> > > -----------------------------------
> > >
> > >

> >
> >

>
>



  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