System.Data.SqlClient.SqlParameterCollection.Add(string, object)' is obsolete: 'Add(String parameterName, Object value) has been deprecated.

For all .NET programmers who are using this


code in ADO.NET 2.0 will get a deprecation message. Instead of using this code, you need to use the following code


this " SqlCommand.Parameters.Add("@MyValue","Value"); " is a ADO.NET 1.1 way of coding, if you are still using this code in ADO.NET 2.0, you will get the following warning message.

" 'System.Data.SqlClient.SqlParameterCollection.Add(string, object)' is obsolete: 'Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value).' C:\Documents and Settings\501597\My Documents\Visual Studio 2005\WebSites\mytool\MyFirstPage.aspx.cs 149 10 C:\...\doc\ "

This is because of some other API changes in the framework. Checkout the list of obsolete changes in the following links


beskito said…
u r genius ... thnx for the help
Thanks man , saved me a lot of effort

Popular posts from this blog

ASP.NET website "Cannot read configuration file due to insufficient permissions" in IIS 7 and Windows Server 2008

Error occurred in deployment step 'Install app for SharePoint': The System Account cannot perform this action.

Windows Server AppFabric: installation error , While installing SharePoint prerequisite installer