Roy Osherove

View Original

VB6 Migration pains - captured as a conversation

Scott Swigart, at one of the mailing lists that I frequent, recently wrote one of those "It'd be funny if it wasn't so sad" kind of emails. With permission, I'm quoting parts of it here. If you're a consultant, this should sound really familiar.
It's a rehash of a conversations between the consultant and customers moving from VB6 to .NET (especially 2.0);;
 
"...
People moving over from VB6 are really struggling with things like:  
  1. You really should use data binding now.  No, I know, you’ve never used it before.  No I know, you tried with earlier versions of VB and felt like you got burned.  No, it’s real this time.  No, really.  Stop typing txtUserName.Text = DataSet.DataTable(0).UserName.  Stop!!!

 

  1. Ok, to use databinding, you just need a BindingSource, DataSource, DataMember, DataSet, DataTable, TableAdapter, and BindingNavigator.  No really, you want to do it this way.  It’s better.  Trust me.  It’s so much easier.

 

  1. Oh, Autonumber.  Um, partial class the TableAdapter to get at the DataAdapter, uh, DataSetTableAdapter namespace, um, let’s see, AddHandler OnRowUpdated…  No really, this is better.  STOP TYPING txtUserName.Text =

 

  1. Well, you see, if you would just use SQL Express…  Look, Access isn’t really supported.  Yes, I know the IDE lets you add an Access datasource, and builds the typed dataset, and all that, but trust me, it’s not really supported.   How big’s express?  About 50MB.  No, that’s not big.  Uh, no, that doesn’t include the Framework.  Yes, you’re looking at 70MB + however big your app is, but in this day and age, that’s really not so much.  Your app used to be a 3 MB download?  But that was before .NET.  “That’s the point.” You say?  Well, we think it’s secure.  Yes, we thought MSDE was secure too, but they’ve done a lot of work since they thought that was secure, and now they really think this is secure.  No, I won’t refund my consulting fees if I advise you to use it, and there’s some security hole that no one knows about today, and it causes a major headache for you.  You have to take some risks you know.  Access isn’t safe either.  Well, I know Slammer didn’t affect Access, but SQL is safe and Access isn’t.  STOP TYPING txtUserName.Text =.  You’re doing it the hard way!  Don’t use Access, it’s not really supported!

 

  1. Oh, you want it to show up in a different format than in the database.  Uh, Databinding, uh, advanced.  See here, “Format type”, um, custom.  No, you just think it’s easy if you use txtUserName.text=, uh, what’s this warning, oh yeah, Format and Parse events.  Um let’s see, we get to the binding object for the textbox by, uh, AddHandler…

 

  1. It’s not getting saved in the database?  Um, did you call Validate?  How about EndEdit?  Stop typing DataSet.DataTable(0).UserName = txtUserName.Text.  That’s the wrong way.  Wrong. Wrong. Wrong. Wrong!!!  So what if it works.  Microsoft says… What so you mean this isn’t working out?  What do you mean, you’re going to try another consultant?  BUT… MICROSOFT… SAYS….
..."