OdbcParameter コンストラクター
定義
OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class.
オーバーロード
OdbcParameter() |
OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class. |
OdbcParameter(String, OdbcType) |
パラメーター名とデータ型を指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name and data type. |
OdbcParameter(String, Object) |
パラメーター名と OdbcParameter オブジェクトを指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name and an OdbcParameter object. |
OdbcParameter(String, OdbcType, Int32) |
パラメーター名、データ型、および長さを指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, and length. |
OdbcParameter(String, OdbcType, Int32, String) |
パラメーター名、データ型、長さ、およびソース列名を指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, length, and source column name. |
OdbcParameter(String, OdbcType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object) |
パラメーター名、データ型、長さ、ソース列名、パラメーターの方向、数値の有効桁数、およびその他のプロパティを使用する OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, length, source column name, parameter direction, numeric precision, and other properties. |
OdbcParameter(String, OdbcType, Int32, ParameterDirection, Byte, Byte, String, DataRowVersion, Boolean, Object) |
パラメーター名、データ型、長さ、ソース列名、パラメーターの方向、数値の有効桁数、およびその他のプロパティを使用する OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, length, source column name, parameter direction, numeric precision, and other properties. |
OdbcParameter()
OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class.
public:
OdbcParameter();
public OdbcParameter ();
Public Sub New ()
例
次の例では、を作成 OdbcParameter し、そのプロパティの一部を設定します。The following example creates an OdbcParameter and sets some of its properties.
public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter();
parameter.ParameterName = "Description";
parameter.OdbcType = OdbcType.VarChar;
parameter.Direction = ParameterDirection.Output;
parameter.Size = 88;
}
Public Sub CreateOdbcParameter()
Dim parameter As New OdbcParameter()
parameter.ParameterName = "Description"
parameter.OdbcType = OdbcType.VarChar
parameter.Direction = ParameterDirection.Output
parameter.Size = 88
End Sub
注釈
基本コンストラクターは、すべてのフィールドを既定値に初期化します。The base constructor initializes all fields to their default values.
こちらもご覧ください
適用対象
OdbcParameter(String, OdbcType)
パラメーター名とデータ型を指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name and data type.
public:
OdbcParameter(System::String ^ name, System::Data::Odbc::OdbcType type);
public OdbcParameter (string name, System.Data.Odbc.OdbcType type);
public OdbcParameter (string? name, System.Data.Odbc.OdbcType type);
new System.Data.Odbc.OdbcParameter : string * System.Data.Odbc.OdbcType -> System.Data.Odbc.OdbcParameter
Public Sub New (name As String, type As OdbcType)
パラメーター
- name
- String
パラメーターの名前。The name of the parameter.
例外
type
パラメーターの指定された値が、正しくないバックエンド データ型です。The value supplied in the type
parameter is an invalid back-end data type.
例
次の例では、を作成 OdbcParameter し、そのプロパティの一部を設定します。The following example creates an OdbcParameter and sets some of its properties.
public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter("Description",OdbcType.VarChar);
parameter.Direction = ParameterDirection.Output;
parameter.Size = 88;
}
Public Sub CreateOdbcParameter()
Dim parameter As New OdbcParameter("Description", OdbcType.VarChar)
parameter.Direction = ParameterDirection.Output
parameter.Size = 88
End Sub
こちらもご覧ください
適用対象
OdbcParameter(String, Object)
パラメーター名と OdbcParameter オブジェクトを指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name and an OdbcParameter object.
public:
OdbcParameter(System::String ^ name, System::Object ^ value);
public OdbcParameter (string name, object value);
public OdbcParameter (string? name, object? value);
new System.Data.Odbc.OdbcParameter : string * obj -> System.Data.Odbc.OdbcParameter
Public Sub New (name As String, value As Object)
パラメーター
- name
- String
パラメーターの名前。The name of the parameter.
- value
- Object
OdbcParameter オブジェクト。An OdbcParameter object.
注釈
コンストラクターのこのオーバーロードを使用して整数のパラメーター値を指定する場合は、注意が必要 OdbcParameter です。Use caution when you are using this overload of the OdbcParameter constructor to specify integer parameter values. このオーバーロードは Object 型の value
を受け取るため、次の C# の例のように、値が 0 の場合に整数値を Object 型に変換する必要があります。Because this overload takes a value
of type Object, you must convert the integral value to an Object type when the value is zero, as the following C# example demonstrates.
Parameter = new OdbcParameter("@pname", Convert.ToInt32(0));
この変換を実行しない場合、コンパイラは、コンストラクターのオーバーロードを呼び出そうとしていることを前提としてい OdbcParameter.OdbcParameter ます。If you do not perform this conversion, the compiler assumes that you are trying to call the OdbcParameter.OdbcParameter constructor overload.
こちらもご覧ください
適用対象
OdbcParameter(String, OdbcType, Int32)
パラメーター名、データ型、および長さを指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, and length.
public:
OdbcParameter(System::String ^ name, System::Data::Odbc::OdbcType type, int size);
public OdbcParameter (string name, System.Data.Odbc.OdbcType type, int size);
public OdbcParameter (string? name, System.Data.Odbc.OdbcType type, int size);
new System.Data.Odbc.OdbcParameter : string * System.Data.Odbc.OdbcType * int -> System.Data.Odbc.OdbcParameter
Public Sub New (name As String, type As OdbcType, size As Integer)
パラメーター
- name
- String
パラメーターの名前。The name of the parameter.
- size
- Int32
パラメーターの長さ。The length of the parameter.
例外
type
パラメーターの指定された値が、正しくないバックエンド データ型です。The value supplied in the type
parameter is an invalid back-end data type.
例
次の例では、を作成 OdbcParameter し、そのプロパティの一部を設定します。The following example creates an OdbcParameter and sets some of its properties.
public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter("Description",OdbcType.VarChar,88);
parameter.Direction = ParameterDirection.Output;
}
Public Sub CreateOdbcParameter()
Dim parameter As New OdbcParameter("Description", OdbcType.VarChar, 88)
parameter.Direction = ParameterDirection.Output
End Sub
こちらもご覧ください
適用対象
OdbcParameter(String, OdbcType, Int32, String)
パラメーター名、データ型、長さ、およびソース列名を指定して、OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, length, and source column name.
public:
OdbcParameter(System::String ^ name, System::Data::Odbc::OdbcType type, int size, System::String ^ sourcecolumn);
public OdbcParameter (string name, System.Data.Odbc.OdbcType type, int size, string sourcecolumn);
public OdbcParameter (string? name, System.Data.Odbc.OdbcType type, int size, string? sourcecolumn);
new System.Data.Odbc.OdbcParameter : string * System.Data.Odbc.OdbcType * int * string -> System.Data.Odbc.OdbcParameter
Public Sub New (name As String, type As OdbcType, size As Integer, sourcecolumn As String)
パラメーター
- name
- String
パラメーターの名前。The name of the parameter.
- size
- Int32
パラメーターの長さ。The length of the parameter.
- sourcecolumn
- String
変換元列の名前です。The name of the source column.
例外
type
パラメーターの指定された値が、正しくないバックエンド データ型です。The value supplied in the type
parameter is an invalid back-end data type.
例
次の例では、を作成 OdbcParameter し、そのプロパティの一部を設定します。The following example creates an OdbcParameter and sets some of its properties.
public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter("Description",OdbcType.VarChar,
88,"Description");
parameter.Direction = ParameterDirection.Output;
}
Public Sub CreateOdbcParameter()
Dim parameter As New OdbcParameter("Description", OdbcType.VarChar, 88, "Description")
parameter.Direction = ParameterDirection.Output
End Sub
こちらもご覧ください
適用対象
OdbcParameter(String, OdbcType, Int32, ParameterDirection, Boolean, Byte, Byte, String, DataRowVersion, Object)
パラメーター名、データ型、長さ、ソース列名、パラメーターの方向、数値の有効桁数、およびその他のプロパティを使用する OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, length, source column name, parameter direction, numeric precision, and other properties.
public:
OdbcParameter(System::String ^ parameterName, System::Data::Odbc::OdbcType odbcType, int size, System::Data::ParameterDirection parameterDirection, bool isNullable, System::Byte precision, System::Byte scale, System::String ^ srcColumn, System::Data::DataRowVersion srcVersion, System::Object ^ value);
public OdbcParameter (string parameterName, System.Data.Odbc.OdbcType odbcType, int size, System.Data.ParameterDirection parameterDirection, bool isNullable, byte precision, byte scale, string srcColumn, System.Data.DataRowVersion srcVersion, object value);
public OdbcParameter (string? parameterName, System.Data.Odbc.OdbcType odbcType, int size, System.Data.ParameterDirection parameterDirection, bool isNullable, byte precision, byte scale, string? srcColumn, System.Data.DataRowVersion srcVersion, object? value);
new System.Data.Odbc.OdbcParameter : string * System.Data.Odbc.OdbcType * int * System.Data.ParameterDirection * bool * byte * byte * string * System.Data.DataRowVersion * obj -> System.Data.Odbc.OdbcParameter
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)
パラメーター
- parameterName
- String
パラメーターの名前。The name of the parameter.
- size
- Int32
パラメーターの長さ。The length of the parameter.
- parameterDirection
- ParameterDirection
ParameterDirection 値のいずれか 1 つ。One of the ParameterDirection values.
- isNullable
- Boolean
フィールドの値を NULL に設定できる場合は true
。それ以外の場合は false
。true
if the value of the field can be null; otherwise false
.
- precision
- Byte
Value を解決する際の、小数点の左側および右側の桁数の合計。The total number of digits to the left and right of the decimal point to which Value is resolved.
- srcColumn
- String
変換元列の名前です。The name of the source column.
- srcVersion
- DataRowVersion
DataRowVersion 値のいずれか 1 つ。One of the DataRowVersion values.
- value
- Object
OdbcParameter の値である Object。An Object that is the value of the OdbcParameter.
例外
type
パラメーターの指定された値が、正しくないバックエンド データ型です。The value supplied in the type
parameter is an invalid back-end data type.
例
次の例では、を作成 OdbcParameter し、を表示し ParameterName ます。The following example creates an OdbcParameter and displays the ParameterName.
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());
}
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
こちらもご覧ください
適用対象
OdbcParameter(String, OdbcType, Int32, ParameterDirection, Byte, Byte, String, DataRowVersion, Boolean, Object)
パラメーター名、データ型、長さ、ソース列名、パラメーターの方向、数値の有効桁数、およびその他のプロパティを使用する OdbcParameter クラスの新しいインスタンスを初期化します。Initializes a new instance of the OdbcParameter class that uses the parameter name, data type, length, source column name, parameter direction, numeric precision, and other properties.
public:
OdbcParameter(System::String ^ parameterName, System::Data::Odbc::OdbcType odbcType, int size, System::Data::ParameterDirection parameterDirection, System::Byte precision, System::Byte scale, System::String ^ sourceColumn, System::Data::DataRowVersion sourceVersion, bool sourceColumnNullMapping, System::Object ^ value);
public OdbcParameter (string parameterName, System.Data.Odbc.OdbcType odbcType, int size, System.Data.ParameterDirection parameterDirection, byte precision, byte scale, string sourceColumn, System.Data.DataRowVersion sourceVersion, bool sourceColumnNullMapping, object value);
public OdbcParameter (string? parameterName, System.Data.Odbc.OdbcType odbcType, int size, System.Data.ParameterDirection parameterDirection, byte precision, byte scale, string? sourceColumn, System.Data.DataRowVersion sourceVersion, bool sourceColumnNullMapping, object? value);
new System.Data.Odbc.OdbcParameter : string * System.Data.Odbc.OdbcType * int * System.Data.ParameterDirection * byte * byte * string * System.Data.DataRowVersion * bool * obj -> System.Data.Odbc.OdbcParameter
Public Sub New (parameterName As String, odbcType As OdbcType, size As Integer, parameterDirection As ParameterDirection, precision As Byte, scale As Byte, sourceColumn As String, sourceVersion As DataRowVersion, sourceColumnNullMapping As Boolean, value As Object)
パラメーター
- parameterName
- String
パラメーターの名前。The name of the parameter.
- size
- Int32
パラメーターの長さ。The length of the parameter.
- parameterDirection
- ParameterDirection
ParameterDirection 値のいずれか 1 つ。One of the ParameterDirection values.
- precision
- Byte
Value を解決する際の、小数点の左側および右側の桁数の合計。The total number of digits to the left and right of the decimal point to which Value is resolved.
- sourceColumn
- String
変換元列の名前です。The name of the source column.
- sourceVersion
- DataRowVersion
DataRowVersion 値のいずれか 1 つ。One of the DataRowVersion values.
- sourceColumnNullMapping
- Boolean
対応するソース列が null 許容である場合は true
。それ以外の場合は false
。true
if the corresponding source column is nullable; false
if it is not.
- value
- Object
OdbcParameter の値である Object。An Object that is the value of the OdbcParameter.
例外
type
パラメーターの指定された値が、正しくないバックエンド データ型です。The value supplied in the type
parameter is an invalid back-end data type.
例
次の例では、を作成 OdbcParameter し、を表示し ParameterName ます。The following example creates an OdbcParameter and displays the ParameterName.
Public Sub CreateOdbcParameter()
Dim parameter As New OdbcParameter("Description", OdbcType.VarChar, 11, ParameterDirection.Output, True, 0, 0, "Description", DataRowVersion.Current, False, "garden hose")
MessageBox.Show(parameter.ToString())
End Sub
public void CreateOdbcParameter()
{
OdbcParameter parameter = new OdbcParameter("Description",OdbcType.VarChar,
11,ParameterDirection.Output,true,0,0,"Description",
DataRowVersion.Current, false, "garden hose");
MessageBox.Show(parameter.ToString());
}