相关文章推荐
激动的充值卡  ·  alpine linux ...·  8 月前    · 
激动的充值卡  ·  Create a JavaScript ...·  11 月前    · 
激动的充值卡  ·  jenkins operation not ...·  11 月前    · 
豪情万千的眼镜  ·  智能指针reset()·  54 分钟前    · 
任性的筷子  ·  std::packaged_task::re ...·  54 分钟前    · 
爱喝酒的火车  ·  QueryMetricByPage - ...·  1小时前    · 
一身肌肉的大葱  ·  Solving the ...·  1小时前    · 
玩篮球的火锅  ·  日常点滴 - 一抹浅笑 ·  1小时前    · 
奔放的包子  ·  How to use OpenAPI in ...·  3 小时前    · 
刚毅的刺猬  ·  I want to dock my ...·  3 小时前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
public ref class SqlParameter sealed : System::Data::Common::DbParameter, ICloneable
public ref class SqlParameter sealed : System::Data::Common::DbParameter
public ref class SqlParameter sealed : MarshalByRefObject, ICloneable, System::Data::IDbDataParameter
public sealed class SqlParameter : System.Data.Common.DbParameter, ICloneable
[System.ComponentModel.TypeConverter(typeof(System.Data.SqlClient.SqlParameter+SqlParameterConverter))]
public sealed class SqlParameter : System.Data.Common.DbParameter, ICloneable
public sealed class SqlParameter : System.Data.Common.DbParameter
[System.ComponentModel.TypeConverter(typeof(System.Data.SqlClient.SqlParameterConverter))]
public sealed class SqlParameter : MarshalByRefObject, ICloneable, System.Data.IDbDataParameter
[System.ComponentModel.TypeConverter("System.Data.SqlClient.SqlParameter+SqlParameterConverter, System.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public sealed class SqlParameter : System.Data.Common.DbParameter, ICloneable
[System.ComponentModel.TypeConverter("System.Data.SqlClient.SqlParameter+SqlParameterConverter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public sealed class SqlParameter : System.Data.Common.DbParameter, ICloneable
type SqlParameter = class
    inherit DbParameter
    interface ICloneable
[<System.ComponentModel.TypeConverter(typeof(System.Data.SqlClient.SqlParameter+SqlParameterConverter))>]
type SqlParameter = class
    inherit DbParameter
    interface ICloneable
type SqlParameter = class
    inherit DbParameter
[<System.ComponentModel.TypeConverter(typeof(System.Data.SqlClient.SqlParameterConverter))>]
type SqlParameter = class
    inherit MarshalByRefObject
    interface IDbDataParameter
    interface IDataParameter
    interface ICloneable
[<System.ComponentModel.TypeConverter(typeof(System.Data.SqlClient.SqlParameter+SqlParameterConverter))>]
type SqlParameter = class
    inherit DbParameter
    interface IDbDataParameter
    interface IDataParameter
    interface ICloneable
[<System.ComponentModel.TypeConverter("System.Data.SqlClient.SqlParameter+SqlParameterConverter, System.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")>]
type SqlParameter = class
    inherit DbParameter
    interface IDbDataParameter
    interface IDataParameter
    interface ICloneable
[<System.ComponentModel.TypeConverter("System.Data.SqlClient.SqlParameter+SqlParameterConverter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")>]
type SqlParameter = class
    inherit DbParameter
    interface IDbDataParameter
    interface IDataParameter
    interface ICloneable
Public NotInheritable Class SqlParameter
Inherits DbParameter
Implements ICloneable
Public NotInheritable Class SqlParameter
Inherits DbParameter
Public NotInheritable Class SqlParameter
Inherits MarshalByRefObject
Implements ICloneable, IDbDataParameter
Inheritance
SqlParameter

Examples

The following example creates multiple instances of SqlParameter through the SqlParameterCollection collection within the SqlDataAdapter . These parameters are used to select data from the data source and put the data in the DataSet . This example assumes that a DataSet and a SqlDataAdapter have already been created by using the appropriate schema, commands, and connection. For more information and additional examples on using parameters, see Retrieving and Modifying Data in ADO.NET and Configuring Parameters and Parameter Data Types .

public void AddSqlParameters() // ... // create categoriesDataSet and categoriesAdapter // ... categoriesAdapter.SelectCommand.Parameters.Add( "@CategoryName", SqlDbType.VarChar, 80).Value = "toasters"; categoriesAdapter.SelectCommand.Parameters.Add( "@SerialNum", SqlDbType.Int).Value = 239; categoriesAdapter.Fill(categoriesDataSet); Public Sub AddSqlParameters() ' ... ' create categoriesDataSet and categoriesAdapter ' ... categoriesAdapter.SelectCommand.Parameters.Add( _ "@CategoryName", SqlDbType.VarChar, 80).Value = "toasters" categoriesAdapter.SelectCommand.Parameters.Add( _ "@SerialNum", SqlDbType.Int).Value = 239 categoriesAdapter.Fill(categoriesDataSet) End Sub

Remarks

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 .

SqlParameter(String, SqlDbType, Int32, ParameterDirection, Byte, Byte, String, DataRowVersion, Boolean, Object, String, String, String)

Initializes a new instance of the SqlParameter 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 DataRowVersion 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.

Enforces encryption of a parameter when using Always Encrypted . If SQL Server informs the driver that the parameter does not need to be encrypted, the query using the parameter will fail. This property provides additional protection against security attacks that involve a compromised SQL Server providing incorrect encryption metadata to the client, which may lead to data disclosure.

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject ) Obsolete.

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject ) Obsolete.

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject )
 
推荐文章