次の方法で共有


OdbcParameter コンストラクタ (String, OdbcType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object)

パラメータの名前、データ型、長さ、ソース列名、パラメータの方向、数値の精度、およびその他のプロパティを指定して、OdbcParameter クラスの新しいインスタンスを初期化します。

名前空間: System.Data.Odbc
アセンブリ: System.Data (system.data.dll 内)

構文

'宣言
Public Sub New ( _
    parameterName As String, _
    odbcType As OdbcType, _
    size As Integer, _
    parameterDirection As ParameterDirection, _
    isNullable As Boolean, _
    precision As Byte, _
    scale As Byte, _
    srcColumn As String, _
    srcVersion As DataRowVersion, _
    value As Object _
)
'使用
Dim parameterName As String
Dim odbcType As OdbcType
Dim size As Integer
Dim parameterDirection As ParameterDirection
Dim isNullable As Boolean
Dim precision As Byte
Dim scale As Byte
Dim srcColumn As String
Dim srcVersion As DataRowVersion
Dim value As Object

Dim instance As New OdbcParameter(parameterName, odbcType, size, parameterDirection, isNullable, precision, scale, srcColumn, srcVersion, value)
public OdbcParameter (
    string parameterName,
    OdbcType odbcType,
    int size,
    ParameterDirection parameterDirection,
    bool isNullable,
    byte precision,
    byte scale,
    string srcColumn,
    DataRowVersion srcVersion,
    Object value
)
public:
OdbcParameter (
    String^ parameterName, 
    OdbcType odbcType, 
    int size, 
    ParameterDirection parameterDirection, 
    bool isNullable, 
    unsigned char precision, 
    unsigned char scale, 
    String^ srcColumn, 
    DataRowVersion srcVersion, 
    Object^ value
)
public OdbcParameter (
    String parameterName, 
    OdbcType odbcType, 
    int size, 
    ParameterDirection parameterDirection, 
    boolean isNullable, 
    byte precision, 
    byte scale, 
    String srcColumn, 
    DataRowVersion srcVersion, 
    Object value
)
public function OdbcParameter (
    parameterName : String, 
    odbcType : OdbcType, 
    size : int, 
    parameterDirection : ParameterDirection, 
    isNullable : boolean, 
    precision : byte, 
    scale : byte, 
    srcColumn : String, 
    srcVersion : DataRowVersion, 
    value : Object
)

パラメータ

  • parameterName
    パラメータの名前。
  • size
    パラメータの長さ。
  • isNullable
    フィールドの値を null にできる場合は true。それ以外の場合は false
  • precision
    Value を解決するための、小数点の左右の合計桁数。
  • scale
    Value を解決するための、小数部の桁数。
  • srcColumn
    ソース列の名前。

例外

例外の種類 条件

ArgumentException

type パラメータで指定された値は、無効なバックエンド データ型です。

使用例

OdbcParameter を作成し、.Data.Odbc.OdbcParameter.ParameterName を表示する例を次に示します。

Public Sub CreateOdbcParameter()
    Dim parameter As New OdbcParameter("Description", OdbcType.VarChar, _
        11, ParameterDirection.Output, True, 0, 0, "Description", _
        DataRowVersion.Current, "garden hose")
    Console.WriteLine(parameter.ToString())
End Sub
public void CreateOdbcParameter()
{
    OdbcParameter parameter = new OdbcParameter(
        "Description", OdbcType.VarChar, 11, 
        ParameterDirection.Output, true, 0, 0, "Description",
        DataRowVersion.Current, "garden hose");
    Console.WriteLine(parameter.ToString());
}

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1

参照

関連項目

OdbcParameter クラス
OdbcParameter メンバ
System.Data.Odbc 名前空間

その他の技術情報

コマンドの使用