Typed Datasets - Safe to modify?

  • Thread starter Thread starter W.G. Rowland
  • Start date Start date
W

W.G. Rowland

Having struggled in vain with the idea of making custom business objects,
I'm now wondering how safe it is to just modify a Typed Dataset.

It would be simple enough to add validation logic to the property code. My
fear is that once I've modified the dataset code, Visual Studio is going to
go and change the code if I hit the wrong key..

Here are the steps I go through to create the typed dataset:

1) Create a class library project to contain them
2) Add New Item - Dataset to the project
3) Create the schema, adding tables and relations
4) Generate the dataset..
5) Modify the .vb file with my customizations..

My question is, is there any way in VS, other than specifically going into
the schema and selecting Generate Dataset, that will cause VS to rebuild the
code for the dataset? If there is, I need to know so I can avoid
accidentally deleting my custom datasets once I've built them..

Hopefully, I'm just paranoid, but I have been bitten before by MS's tendancy
to gleefully reformat and rewrite your work on a whim.

Thanks in advance,
W.G. Rowland
 
W.G. Rowland said:
Having struggled in vain with the idea of making custom business objects,
I'm now wondering how safe it is to just modify a Typed Dataset.

The safe way to modify a Typed Dataset is to extend it.
Let VS generate your typed dataset class. You write a new class that
inherits the Typed Dataset class and adds or changes functionality. That
way you can still drag and drop into the schema file and let VS generate
your typed dataset.

Unfortunately there is no easy way to extend the DataTable classes inside
the typed dataset, so this approach has its limits.

Another approach is to wrapper the DataSet inside your custom business
object. This is slightly more work, but you have more control.

David
 
Sigh, that's what I was afraid of.. Believe me, I want to build my own
objects, in fact I've already put in a decent amount of effort on just that.
It's just that every time I make another step forward I realize 10-12 pieces
of the puzzle I'm missing.

Right now my biggest hinderance towards using custom business objects is the
fact that I have no idea how to bind data relationships in a way that will
allow me to achieve Master/detail views of data on forms that stay properly
updated when the master record changes. I am new to OO programming.. I'm
doing my best to get up to speed, but I'm having a heck of a time finding
out which interfaces I need to implement, and then even more trouble finding
decent documentation on them..

I'll keep looking into it, because I want to know how to make this stuff
work, but it certainly feels like .Net has made this a much harder task than
it should be.. Especially for smaller applications.. (This app is merely a
client for SQL Server Desktop, both on the same machine..)

Thanks again,
WGR
 
Back
Top