Jeffrey Palermo (.com)

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
With ADO.NET, if the DB schema changes, restart your app - level 200

Wow!  Hard-to-find bugs can really give you insight into how the .Net Framework works.  I recently just battled an elusive bug that turned out to be quite simple.  In a history table, I logged events.  Each event had a description that a user could type in.  Well, I noticed that longer descriptions were being cut off short.  I looked at the database and noticed that my nvarchar(50) field was the culprit.  So I just changed it to nvarchar(4000) to give the users the most flexibility.  I change the corresponding stored proc to mimic the new field length and then went to test the change.  No dice.  It still cut off my description.  What gives?

ADO.NET!!!  I use an ADO.NET command to call my stored procedure.  The description was being truncated in the ADO call.  I restarted the app, and it worked fine.  ADO caches information about sproc parameters, and I had to restart the app for that cache to be recreated with the new length.


Posted 10-03-2004 1:37 PM by Jeffrey Palermo

[Advertisement]

Comments

Rich Denis wrote re: With ADO.NET, if the DB schema changes, restart your app - level 200
on 10-03-2004 4:33 PM
Were you using the Data Access Blocks? I know that this is a problem with the parameters being cached there but I have not heard of this as part of the ADO.NET library.
Jeffrey Palermo wrote re: With ADO.NET, if the DB schema changes, restart your app - level 200
on 10-04-2004 1:57 AM
Actually, I am using the Data Access Application Block. Thanks for the tip.