System.Data [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.3300.0 1.0.5000.0 2.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Data.Common.DbParameter System.ICloneable System.ComponentModel.TypeConverter("System.Data.SqlClient.SqlParameter+SqlParameterConverter, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")

Parameter names are not case sensitive.

Nameless, also called ordinal, parameters are not supported by the .NET Framework Data Provider for SQL Server.

For more information, along with additional sample code demonstrating how to use parameters, see Commands and Parameters (ADO.NET).

Represents a parameter to a and optionally its mapping to columns. This class cannot be inherited. For more information on parameters, see Configuring Parameters and Parameter Data Types (ADO.NET).

- Constructor
  To be added

  Initializes a new instance of the class.

  1.0.5000.0
  2.0.0.0
- Constructor

  The data type and, if appropriate, Size and are inferred from the value of the parameter.

  Initializes a new instance of the class that uses the parameter name and the data type.

  The name of the parameter to map.
  One of the values.
  1.0.5000.0
  2.0.0.0
- Constructor

  When you specify an in the parameter, the is inferred from the Microsoft .NET Framework type of the .

  Use caution when you use this overload of the constructor to specify integer parameter values. Because this overload takes a of type , you must convert the integral value to an type when the value is zero, as the following C# example demonstrates.

  Parameter = new SqlParameter("@pname", (object)0);

  If you do not perform this conversion, the compiler assumes that you are trying to call the SqlParameter (, ) constructor overload.

  Initializes a new instance of the class that uses the parameter name and a value of the new .

  The name of the parameter to map.
  An that is the value of the .
  1.0.5000.0
  2.0.0.0
- Constructor

  The Size is inferred from the value of the parameter if it is not explicitly set in the parameter.

  Initializes a new instance of the class that uses the parameter name, the , and the size.

  The name of the parameter to map.
  One of the values.
  The length of the parameter.
  1.0.5000.0
  2.0.0.0
- Constructor

  The Size is inferred from the value of the parameter if it is not explicitly set in the parameter.

  Initializes a new instance of the class that uses the parameter name, the , the size, and the source column name.

  The name of the parameter to map.
  One of the values.
  The length of the parameter.
  The name of the source column () if this is used in a call to .
  1.0.5000.0
  2.0.0.0
- Constructor

  The Size and are inferred from the value of the parameter if they are not explicitly set in the and parameters.

  Initializes a new instance of the class that uses the parameter name, the type of the parameter, the size of the parameter, a , the precision of the parameter, the scale of the parameter, the source column, a to use, and the value of the parameter.

  The name of the parameter to map.
  One of the values.
  The length of the parameter.
  One of the values.
  true if the value of the field can be null; otherwise false.
  The total number of digits to the left and right of the decimal point to which is resolved.
  The total number of decimal places to which is resolved.
  The name of the source column () if this is used in a call to .
  One of the values.
  An that is the value of the .
  1.0.5000.0
  2.0.0.0
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
- Constructor
  2.0.0.0

  The and are inferred from the value of the parameter if they are not explicitly set in the and parameters.

  Initializes a new instance of the class that uses the parameter name, the type of the parameter, the length of the parameter the direction, the precision, the scale, the name of the source column, one of the values, a Boolean for source column mapping, the value of the SqlParameter, the name of the database where the schema collection for this XML instance is located, the owning relational schema where the schema collection for this XML instance is located, and the name of the schema collection for this parameter.

  The name of the parameter to map.
  One of the values.
  The length of the parameter.
  One of the values.
  The total number of digits to the left and right of the decimal point to which is resolved.
  The total number of decimal places to which is resolved.
  The name of the source column () if this is used in a call to .
  One of the values.
  true if the source column is nullable; false if it is not.
  An that is the value of the .
  The name of the database where the schema collection for this XML instance is located.
  The owning relational schema where the schema collection for this XML instance is located.
  The name of the schema collection for this parameter.
- Property
  2.0.0.0
  System.ComponentModel.Browsable(false)
  System.Data.SqlTypes.SqlCompareOptions To be added. To be added.

  Gets or sets the object that defines how string comparisons should be performed for this parameter.

- Property
  System.Data.DbType To be added: an object of type 'Data.DbType'

  The and are linked. Therefore, setting the changes the to a supporting .

  For a list of the supported data types, see the appropriate member. For more information, see Using Parameters with a DataAdapter.

  Gets or sets the of the parameter.

  1.0.5000.0
  2.0.0.0
- Property
  System.Data.ParameterDirection To be added: an object of type 'Data.ParameterDirection'

  If the is output, and execution of the associated does not return a value, the contains a null value.

  Output, InputOut, and ReturnValue parameters returned by calling cannot be accessed until you close the .

  Gets or sets a value that indicates whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
- Property
  System.Boolean To be added: an object of type 'bool'

  Null values are handled using the class.

  Gets or sets a value that indicates whether the parameter accepts null values. is not used to validate the parameter’s value and will not prevent sending or receiving a null value when executing a command.

  1.0.5000.0
  2.0.0.0
- Property
  2.0.0.0
  System.ComponentModel.Browsable(false)
  System.Int32 To be added.

  The locale identifies conventions and language for a particular geographical region. The codepage used to encode a specific string (the character set) is based on the locale used by that string or the environment that produced it. This property sets (for input parameters) or gets (for output parameters) the locale to be attached to a string when exchanging data with the server. This property is typically used together with the property.

  `static void CreateSqlParameterLocaleId(){ SqlParameter parameter = new SqlParameter("pName", SqlDbType.VarChar); parameter.LocaleId = 1033; // English - United States }`

  Gets or sets the locale identifier that determines conventions and language for a particular region.

- Property
  System.Int32 To be added: an object of type 'int'

  The Offset property is used for client-side chunking of binary and string data. For example, in order to insert 10MB of text into a column on a server, a user might execute 10 parameterized inserts of 1MB chunks, shifting the value of Offset on each iteration by 1MB.

  Offset specifies the number of bytes for binary types, and the number of characters for strings. The count for strings does not include the terminating character.

  Gets or sets the offset to the property.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)
  System.ComponentModel.Browsable(false)
- Property
  System.String To be added: an object of type 'string'

  The is specified in the form @paramname. You must set before executing a that relies on parameters.

  Gets or sets the name of the .

  1.0.5000.0
  2.0.0.0
- Property
  System.Byte To be added: an object of type 'byte'

  The property is used by parameters that have a of Decimal.

  You do not need to specify values for the and properties for input parameters, as they can be inferred from the parameter value. Precision and Scale are required for output parameters and for scenarios where you need to specify complete metadata for a parameter without indicating a value, such as specifying a null value with a specific precision and scale.

  Use of this property to coerce data passed to the database is not supported. To round, truncate, or otherwise coerce data before passing it to the database, use the class that is part of the System namespace prior to assigning a value to the parameter's Value property.

  Microsoft .NET Framework data providers that are included with the .NET Framework version 1.0 do not verify the or of parameter values. This can cause truncated data being inserted at the data source. If you are using .NET Framework version 1.0, validate the and of values before setting the parameter value. When you use .NET Framework version 1.1 or a later version, an exception is thrown if a parameter value is set with an invalid . values that exceed the parameter scale are still truncated.

  Gets or sets the maximum number of digits used to represent the property.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.DefaultValue(0)
- Method
  2.0.0.0
  System.Void

  When executing a command that includes parameter values, code can either set the type of a parameter explicitly, or the parameter can infer its type from its value. Calling this method resets the parameter so that it can again infer its type from the value passed in the parameter. Calling this method affects both the and properties of the .

  Resets the type associated with this .

- Method
  2.0.0.0
  System.Void

  When executing a command that includes parameter values, code can either set the type of a parameter explicitly, or the parameter can infer its type from its value. Calling this method resets the parameter so that it can again infer its type from the value passed in the parameter. Calling this method affects both the and properties of the .

  Resets the type associated with this .

- Property
  System.Byte To be added: an object of type 'byte'

  The property is used by parameters that have a of Decimal.

  Data may be truncated if the property is not explicitly specified and the data on the server does not fit in scale 0 (the default).

  You do not need to specify values for the and properties for input parameters, as they can be inferred from the parameter value. Precision and Scale are required for output parameters and for scenarios where you need to specify complete metadata for a parameter without indicating a value, such as specifying a null value with a specific precision and scale.

  Use of this property to coerce data passed to the database is not supported. To round, truncate, or otherwise coerce data before passing it to the database, use the class that is part of the System namespace prior to assigning a value to the parameter's Value property.

  .NET Framework data providers that are included with the .NET Framework version 1.0 do not verify the or of parameter values. This can cause truncated data to be inserted at the data source. If you are using .NET Framework version 1.0, validate the and of values before setting the parameter value. values that exceed the parameter scale are still truncated.

  Gets or sets the number of decimal places to which is resolved.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.DefaultValue(0)
- Property
  System.Int32 To be added: an object of type 'int'

  Return values are not affected by this property; return parameters from stored procedures are always fixed-size integers.

  For output parameters with a variable length type (nvarchar, for example), the size of the parameter defines the size of the buffer holding the output parameter. The output parameter can be truncated to a size specified with . For character types, the size specified with is in characters.

  The property is used for binary and string types. For parameters of type SqlType.String, Size means length in Unicode characters. For parameters of type SqlType.Xml, Size is ignored.

  For nonstring data types and ANSI string data, the property refers to the number of bytes. For Unicode string data, refers to the number of characters. The count for strings does not include the terminating character.

  For variable-length data types, describes the maximum amount of data to transmit to the server. For example, for a Unicode string value, could be used to limit the amount of data sent to the server to the first one hundred characters.

  If not explicitly set, the size is inferred from the actual size of the specified parameter value.

  If the fractional part of the parameter value is greater than the size, then the value will be truncated to match the size.

  For fixed length data types, the value of is ignored. It can be retrieved for informational purposes, and returns the maximum amount of bytes the provider uses when transmitting the value of the parameter to the server.

  For information about streaming, see SqlClient Streaming Support.

  Gets or sets the maximum size, in bytes, of the data within the column.

  1.0.5000.0
  2.0.0.0
- Property
  System.String To be added: an object of type 'string'

  When is set to anything other than an empty string, the value of the parameter is retrieved from the column with the name. If is set to Input, the value is taken from the . If is set to Output, the value is taken from the data source. A of InputOutput is a combination of both.

  For more information about how to use the property, see Using Parameters with a DataAdapter and Updating the Database with a DataAdapter and the DataSet.

  Gets or sets the name of the source column mapped to the and used for loading or returning the

  1.0.5000.0
  2.0.0.0
- Property
  2.0.0.0
  System.Boolean To be added.

  is used by the to correctly generate update commands when dealing with nullable columns. Generally, use of is limited to developers inheriting from .

  uses this property to determine whether the source column is nullable, and sets this property to true if it is nullable, and false if it is not. When is generating its Update statement, it examines the for each parameter. If the property is true, generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field):

  `((@IsNull_FieldName = 1 AND FieldName IS NULL) OR (FieldName = @Original_FieldName))`

  If for the field is false, generates the following WHERE clause:

  `FieldName = @OriginalFieldName`

  In addition, @IsNull_FieldName contains 1 if the source field contains null, and 0 if it does not. This mechanism allows for a performance optimization in SQL Server, and provides for common code that works across multiple providers.

  Sets or gets a value which indicates whether the source column is nullable. This allows to correctly generate Update statements for nullable columns.

- Property
  System.Data.DataRowVersion To be added: an object of type 'Data.DataRowVersion'

  This property is used by the SqlDataAdapter.UpdateCommand during an update to determine whether the original or current value is used for a parameter value. This lets primary keys be updated. This property is set to the version of the used by the DataRow.Item property, or one of the DataRow.GetChildRows methods of the object.

  Gets or sets the to use when you load

  1.0.5000.0
  2.0.0.0
- Property
  System.Data.SqlDbType To be added: an object of type 'Data.SqlDbType'

  The and are linked. Therefore, setting the changes the to a supporting .

  For a list of the supported data types, see the appropriate member. For more information, see Using Parameters with a DataAdapter.

  For information about streaming, see SqlClient Streaming Support.

  Gets or sets the of the parameter.

  1.0.5000.0
  2.0.0.0
  System.Data.Common.DbProviderSpecificTypeProperty(true)
  System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
- Property
  2.0.0.0
  System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)
  System.ComponentModel.Browsable(false)
  System.Object To be added.

  For input parameters, the value is bound to the that is sent to the server. For output and return value parameters, the value is set on completion of the and after the is closed.

  This property can be set to null or . Use to send a NULL value as the value of the parameter. Use null or do not set to use the default value for the parameter.

  If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. The provider tries to convert any type of value if it supports the interface. Conversion errors may result if the specified type is not compatible with the value.

  Both the and properties can be inferred by setting the .

  The property is overwritten by SqlDataAdapter.UpdateCommand.

  Use the property to return parameter values as common language runtime (CLR) types.

  For information about streaming, see SqlClient Streaming Support.

  Gets or sets the value of the parameter as an SQL type.

- Method
  1.0.5000.0
  2.0.0.0
  System.Object

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  For a description of this member, see .

  A new that is a copy of this instance.

- Method
  System.String To be added

  Gets a string that contains the .

  A string that contains the .

  1.0.5000.0
  2.0.0.0
- Property
  System.Object To be added: an object of type 'object'

  For input parameters, the value is bound to the that is sent to the server. For output and return value parameters, the value is set on completion of the and after the is closed.

  This property can be set to null or . Use to send a NULL value as the value of the parameter. Use null or do not set to use the default value for the parameter.

  An exception is thrown if non-Unicode XML data is passed as a string.

  If the application specifies the database type, the bound value is converted to that type when the provider sends the data to the server. The provider tries to convert any type of value if it supports the interface. Conversion errors may result if the specified type is not compatible with the value.

  Both the and properties can be inferred by setting the Value.

  The property is overwritten by SqlDataAdapter.UpdateCommand.

  For information about streaming, see SqlClient Streaming Support.

  Gets or sets the value of the parameter.

  1.0.5000.0
  2.0.0.0
  System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)
  System.ComponentModel.TypeConverter(typeof(System.ComponentModel.StringConverter))
- Property
  2.0.0.0
  System.String To be added.

  This value is null (Nothing in Microsoft Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case and are also null.

  Gets the name of the database where the schema collection for this XML instance is located.

- Property
  2.0.0.0
  System.String To be added.

  This value is null (Nothing in Microsoft Visual Basic) if there is no associated schema collection. If the value is null, then and are also null.

  Gets the name of the schema collection for this XML instance.

- Property
  2.0.0.0
  System.String To be added.

  This value is null (Nothing in Microsoft Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case and are also null.

  The owning relational schema where the schema collection for this XML instance is located.