Typed Dataset: what happens if the schema changes?

I'm new to C#, and I've just set up a typed Dataset using VS.NET's little wizard.

I was wondering what happens if the schema of the (in this case) SQL Sever table changes?  How does VS.Net handle this?
LVL 2
gdbjohnsonAsked:
Who is Participating?
 
gregoryyoungConnect With a Mentor Commented:
I personally do not recommend them but then again I work on very large applications (400 tables is a good example) ... I personally use object persistance layers as they provide a higher level of encapsulation/flexibility. Using typed datasets is fine I am sure for smaller applications ... yes you would need to regenerate the dataset to fix the schema changes.

http://dotnetjunkies.com/WebLog/bsblog/archive/2004/05/04/12748.aspx

search around on them and you will find people saying alot of good and bad things about them
0
 
gregoryyoungCommented:
it depends on the schema change.

if its a relationship change i.e. a constraint has been changed it may fail completely dependant upon the data it receives
if its a datatype change to a column it may or may not fail depending on if it is changing the intrinsic  .net type being used
if a column is added it will work fine.
0
 
gdbjohnsonAuthor Commented:
so how does VS.Net update the dataset to correct potential failures?  Is it as simple as just re-running the "Generate Dataset" wizard?  I'm trying to guage the kinds of complications that may arise with this feature.  

Do you recommend using Typed Datasets?  They seem powerful, but I've had too much experience with fancy features not working well if you do something that MS doesn't expect to not be careful.

G
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
gdbjohnsonAuthor Commented:
well, this is definately a project of smaller magnitude (development team of 1 :) , so perhaps I will investigate their use.

thanks for your opinion.
0
 
gdbjohnsonAuthor Commented:
sorry to bug you, especially since I've accepted your answer, but given your experience I'd like your opinion on one more thing:

do you use DataBinding in your apps?  does it work well?

I asked this in another question, and 2 people responded with yes.  I was wondering what you thought about it.

G
0
 
gregoryyoungCommented:
As any technology it has its benefits and its drawbacks.

Benefits:
Less code !!
Well tested code
when used with objects pushes a mvc pattern

Drawbacks:
Kind of convoluted to do some more advanced features (i.e. it will do it but it takes some getting used to)
A bit less control over the process

Personally I use databinding mostly to objects (not datasets etc) I am estatic to finally have reasonable support for such. Some of the issues I run into are in dealing with collections and hanving to implement IBindingList on my collections if I want to support various things this is not exactly a trivial process, although much can be done in a base class through reflections. Another spot where I currently have a pain is binding image fields... it is easier to just grab a byte array and push it in as a parameter than it is to setup the parsers/formatters to do it (and less code), from what I have seen 2.0 does a much better job on this though.

Overall though I am quite happy with the databinding model and look forward to the new functionalities being added ... I mean there is nothing worse than code like the following ...

TextBox1.Text = Format(obj.Value1);
TextBox2.Text = Format(obj.Value2);
TextBox3.Text = Format(obj.Value3);
.
.
TextBox229.Text = Format(obj.Value229);

now ... another 229 lines of code to set the data back to the object :)
0
 
gdbjohnsonAuthor Commented:
excellent.  
Thanks alot.  I'd raise the points if I could.  :)

I've been working with VB6 for the last 2 years, and have developed a faint sense of loathing for the language and it's 'features' - especially databinding.

Working in a more solid OOP language like C# is a breath of fresh air - and I[m glad that these features are more robust now.
0
 
gregoryyoungCommented:
no worries, points and a dollar will get me a cup of coffee ...

they are getting even better in 2.0 ;) check out the beta.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.