.NETGURU
Create Adapter From Strongly Typed DataSet
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngdata' list.


Andy Smith
I have a strongly typed, heirarchal dataset that I want to update thru =
an adapter.
Is there an easy way to generate an adapter or class that can do that?

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

Reply to this message...
 
    
Alex Dresko
I use a pretty nice technique for creating DataAdapters. I dunno if it
will help much with your specific scenario, but it works well when
creating any DataAdapter. (This applies only if you're using the IDE
Wizard to create the DataAdapter) Basically, for every DataAdapter that
you need, create a new "Component Class" in your project and add your
DataAdapter to that instead.

The reason I don't like to have more than one DataAdapter in a class is
because VisualStudio automatically puts all of the object creation code
within the function, InitializeComponent(). Hence, if there is more than
one DataAdapter in the class, you can't really control when your
adapters are created. Since DataAdapters generally require a lot of code
to fully initialize, this approach also allows you to reuse the adapters
across multiple tiers and clients.

More DataAdapter tips off the top of my head:

2. Set DataSet.MissionSchemaAction = MissionSchemaAction.AddWithKey
before you fill your dataset. As long as your
contraints/relationships/types are all setup properly in your database,
this makes setting up the DataSet much easier. The alternatives are to
use FillSchema() or progmatically create them yourself. FillSchema()
invokes an extra call to the database (ain't cool) and no one wants to
manually create all that stuff (really ain't cool). Since
DataAdapter.Fill uses the database metadata to retrieve the column type
for each column, you might as well have it create the primary keys,
constraints and relationships while it's connected and retrieving data.

3. I doubt this will help much but maybe someone will appreciate the
advice. Even if your final product is MS Access based, use the MSDE or
SQL in your development environment. As long as you use the
System.Data.OleDb namespace objects and refrain from using
storedprocedures, the only thing you should have to do in your release
product is change the connection string. I use this technique to get
around several annoying limitations involved with using MS Access in the
VisualStudio IDE.

Hey, now that I read through all that again I realize it doesn't have
much to do with your question. :) I guess I just felt like typing. Or
mabye I wanted to feel like I knew what I was talking about. Maybe I
just need to be loved. No, maybe I need beer. TGIF!

Alex Dresko
Three Point Oh!

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Friday, August 09, 2002 3:03 PM
To: aspngdata
Subject: [aspngdata] Create Adapter From Strongly Typed DataSet

I have a strongly typed, heirarchal dataset that I want to update thru
an adapter. Is there an easy way to generate an adapter or class that
can do that?

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.ComponentModel.Component
System.Data.Common.DataAdapter
System.Data.DataSet




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification