CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

John Papa [MVP C#]

.NET Code Samples, Data Access, and Other Musings

SqlParameters.Add(string, object) is Out!

One of the pleasures of working with Beta products is just when your code is working, you find out a method is renamed, its overloads have changed or sometimes its just plain gone. Its part of the sport of development. Being the geek that I am, I actually enjoy running into this once in a while in Beta. Keeps me on my toes. (OK, I know I’m weird). Anyway, ADO.NET’s SqlParameters.Add(string, object) method is being deprecated in ADO.NET v2.

An interesting blog by Jackie Goldstein that points out why this method is being deprecated in ADO.NET v2. At first I was like "WHAT!", but it makes more sense after you read the reasoning behind it. However, you can still achieve the same old functionality by using the new ADO.NET v2 SqlParameters.AddWithValue(string parameterName, object value)

I have to say that Pablo Castro and the ADO.NET Team have been excellent at helping explain why certain ADO.NET changes are coming. I certainly appreciate it.  Kudos to you guys!


Published Apr 06 2005, 09:54 PM by John Papa
Filed under:

Comments

Peter's Gekko said:

A database has a storedproc with some parameters. I don't know exactly what it does, I don't want...
# April 15, 2005 8:35 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About John Papa

John (C# MVP and MCSD.NET) has been working with Microsoft distributed architectures for over 10 years. He has enterprise experience architecting and developing with .NET technologies including ASP.NET as well as WebForms using both C# and VB.NET. He is a baseball fanatic who spends most of his summer nights rooting for the Yankees with his family and his faithful dog, Kadi. John has authored or co-authored several books on ADO, ADO.NET, XML, and SQL Server, is the author of the Data Points column in MSDN Magazine, has presented MSDN WebCasts and can often be found speaking at industry conferences such as VSLive and DevConnections. Check out Devlicio.us!