Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tips for using Visual Studio Typed DataSets?

When using strongly typed dataSets in Visual Studio 2005/2008, if the underlying database schema changes, the only practical way to refresh is to delete the dataset and recreate it from scratch. This is OK unless I need to customize the dataset.

Customizing by extending the partial dataset class allows customizations to be retained, but then a simple FillBy() again becomes a long sequence of SQL.

Is there any way to resynchronize a dataset with the database schema without losing dataset customizations?

like image 642
Mike Avatar asked Oct 14 '22 18:10

Mike


1 Answers

Because typed datasets use generated nested classes, customizations will often be lost. What I do is generate the typed dataset, and then mark several classes as partial. Then I create separate files containing a duplicate nested class structure (also marked partial).

This way I can regenerate my data set and the only update I have to do is to go back and make them partial again. My customizations are kept in separate files.

like image 165
Geoff Cox Avatar answered Oct 25 '22 06:10

Geoff Cox