Updating typed dataset with the designer

D

Dave Taylor

I've been using the dataset designer in Visual Studio to create typed
datasets for my application by dragging over tables from the Server Explorer
and dropping them into the designer. The problem is, when I modify these
tables in SQL Server (typically adding fields and what not), there doesnt
seem to be an easy way to update the typed dataset. If I delete the
previous table definition and drop a new one on, all of the relationships
are broken. Is there an easy way to update the definitions in the dataset
designer that I'm missing? I know I can make the modifications directly to
the element objects, etc. but I was hoping for a more automated approach.
In an ideal world, my table structures would be perfectly planned out so
that I wouldnt be making such changes as I code them...but I've never lived
in that world :)

Thanks

Dave Taylor
 
E

Ernest Morariu

Running again the DataAdapter Configuration Wizard and then Generate DataSet
Wizard should resolve this problem.

Anyway, before altering the fields in the database, it's better to run the
DataAdapter Configuration Wizard and eliminate(from the Select command) the
fields you intend to alter. After you modified the structure of the table
run gain the DataAdapter Configuration Wizard(to include the new fields) and
then
Generate DataSet Wizard to update the typed DataSet class.

Ernest
 
D

Dave Taylor

Thanks for the reply. Though I hadnt used the Wizards to generate the data
set or adapters...I'd only used the data set designer and drag-n-dropped the
SQL tables onto the designer from the Server Explorer, so maybe I'm stuck
with updating the SQL tables and performing the same updates in the designer
:-( I'm not a big fan of the Wizards, they always seem so limited in their
applicability.
 
E

Ernest Morariu

I'd only used the data set designer and drag-n-dropped the
SQL tables onto the designer from the Server Explorer

Doing this you implicitly used the DataAdapter Configuartion Wizard.
You can modify your dataadapters commands running again this
wizard(right-click the dataadapter object in the component-tray and select
the "DataAdapter Configuration...").

Without these two wizards my work would slow down about 20 times. Try them.

Ernest
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top