SqlParameterCollection.Add Method (String, Object)
.NET Framework 2.0
NOTE: This method is now obsolete.
Adds the specified SqlParameter object to the SqlParameterCollection. Namespace: System.Data.SqlClientAssembly: System.Data (in system.data.dll)
[ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value). http://go.microsoft.com/fwlink/?linkid=14202", false)] public SqlParameter Add ( string parameterName, Object value )
/** @attribute ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value). http://go.microsoft.com/fwlink/?linkid=14202", false) */
public SqlParameter Add (
String parameterName,
Object value
)
ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value). http://go.microsoft.com/fwlink/?linkid=14202", false) public function Add ( parameterName : String, value : Object ) : SqlParameter
Parameters
- parameterName
The name of the SqlParameter to add to the collection.
- value
A Object.
Return Value
The index of the new SqlParameter object. Use caution when you are using this overload of the Add method to specify integer parameter values. Because this overload takes a value of type Object, you must convert the integral value to an Object type when the value is zero, as the following C# example demonstrates.
parameters.Add("@pname", Convert.ToInt32(0));
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.