共用方式為


EntityParameter 建構函式 (String, DbType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object)

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

使用指定的屬性,初始化 EntityParameter 類別的新執行個體。

命名空間:  System.Data.Entity.Core.EntityClient
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")> _
Public Sub New ( _
    parameterName As String, _
    dbType As DbType, _
    size As Integer, _
    direction As ParameterDirection, _
    isNullable As Boolean, _
    precision As Byte, _
    scale As Byte, _
    sourceColumn As String, _
    sourceVersion As DataRowVersion, _
    value As Object _
)
'用途
Dim parameterName As String 
Dim dbType As DbType 
Dim size As Integer 
Dim direction As ParameterDirection 
Dim isNullable As Boolean 
Dim precision As Byte 
Dim scale As Byte 
Dim sourceColumn As String 
Dim sourceVersion As DataRowVersion 
Dim value As Object 

Dim instance As New EntityParameter(parameterName, _
    dbType, size, direction, isNullable, _
    precision, scale, sourceColumn, sourceVersion, _
    value)
[SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public EntityParameter(
    string parameterName,
    DbType dbType,
    int size,
    ParameterDirection direction,
    bool isNullable,
    byte precision,
    byte scale,
    string sourceColumn,
    DataRowVersion sourceVersion,
    Object value
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA2214:DoNotCallOverridableMethodsInConstructors")]
public:
EntityParameter(
    String^ parameterName, 
    DbType dbType, 
    int size, 
    ParameterDirection direction, 
    bool isNullable, 
    unsigned char precision, 
    unsigned char scale, 
    String^ sourceColumn, 
    DataRowVersion sourceVersion, 
    Object^ value
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")>]
new : 
        parameterName:string * 
        dbType:DbType * 
        size:int * 
        direction:ParameterDirection * 
        isNullable:bool * 
        precision:byte * 
        scale:byte * 
        sourceColumn:string * 
        sourceVersion:DataRowVersion * 
        value:Object -> EntityParameter
public function EntityParameter(
    parameterName : String, 
    dbType : DbType, 
    size : int, 
    direction : ParameterDirection, 
    isNullable : boolean, 
    precision : byte, 
    scale : byte, 
    sourceColumn : String, 
    sourceVersion : DataRowVersion, 
    value : Object
)

參數

  • isNullable
    類型:System.Boolean
    true 表示參數接受 null 值,否則為 false。
  • precision
    類型:System.Byte
    用來代表值的位數。
  • scale
    類型:System.Byte
    值所解析的小數點位數。
  • sourceColumn
    類型:System.String
    來源資料行的名稱。

請參閱

參考

EntityParameter 類別

EntityParameter 多載

System.Data.Entity.Core.EntityClient 命名空間