Name

SqlParameter

Synopsis

This class represents a parameter for a stored procedure or parameterized query. For information about the basic SqlParameter members, refer to the reference for the System.Data.IDbDataParameter and System.Data.IDataParameter interfaces, which SqlParameter implements.

In addition, the SqlParameter class adds two members. SqlDbType sets the SQL Server data type of a parameter. When you set SqlDbType, DbType is updated automatically with the most compatible value. The other member is the Offset property, which is used for binary and string types. It returns the offset in bytes for a binary parameter and in characters for a string parameter.

public sealed class SqlParameter : MarshalByRefObject, System.Data.IDbDataParameter, 

     System.Data.IDataParameter, ICloneable {

// Public Constructors

   public SqlParameter( );  

   public SqlParameter(string parameterName, object value);  

   public SqlParameter(string parameterName,  System.Data.SqlDbType dbType);

   public SqlParameter(string parameterName, System.Data.SqlDbType dbType, int size);

   public SqlParameter(string parameterName, System.Data.SqlDbType dbType, int size, 

        System.Data.ParameterDirection direction, bool isNullable, byte precision, 

        byte scale, string sourceColumn, System.Data.DataRowVersion sourceVersion, object value);

   public SqlParameter(string parameterName, System.Data.SqlDbType dbType, int size, string sourceColumn);

   public DbType DbType{set; get; }                            // implements System.Data.IDataParameter

   public ParameterDirection Direction{set; get; }             // implements System.Data.IDataParameter

   public bool IsNullable{set; get; }                          // implements System.Data.IDataParameter

   public int Offset{set; get; } 

   public string ParameterName{set; get; }                     // implements System.Data.IDataParameter

   public byte Precision{set; get; }                           // implements System.Data.IDbDataParameter

   public byte Scale{set; get; }                               // implements System.Data.IDbDataParameter

   public int Size{set; get; }                                 // implements System.Data.IDbDataParameter

   public string SourceColumn{set; get; }                      // implements System.Data.IDataParameter

   public DataRowVersion SourceVersion{set; get; }             // implements System.Data.IDataParameter

   public SqlDbType SqlDbType{set; get; } 

   public object Value{set; get; }                             // implements System.Data.IDataParameter

                  // Public Instance Methods

   public override string ToString( );                          // overrides object

}