System.Data.OleDb Namespace
Represents a parameter to an OleDbCommand, and optionally, its mapping to a DataSet column.
Visibility |
Constructor |
Parameters |
public |
OleDbParameter |
( )
|
public |
OleDbParameter |
(
String
name
,
Object
value
)
|
public |
OleDbParameter |
(
String
name
,
OleDbType
dataType
)
|
public |
OleDbParameter |
(
String
name
,
OleDbType
dataType
,
Int32
size
)
|
public |
OleDbParameter |
(
String
name
,
OleDbType
dataType
,
Int32
size
,
String
srcColumn
)
|
public |
OleDbParameter |
(
String
parameterName
,
OleDbType
dbType
,
Int32
size
,
ParameterDirection
direction
,
Boolean
isNullable
,
Byte
precision
,
Byte
scale
,
String
srcColumn
,
DataRowVersion
srcVersion
,
Object
value
)
|
public |
OleDbParameter |
(
String
parameterName
,
OleDbType
dbType
,
Int32
size
,
ParameterDirection
direction
,
Byte
precision
,
Byte
scale
,
String
sourceColumn
,
DataRowVersion
sourceVersion
,
Boolean
sourceColumnNullMapping
,
Object
value
)
|
Visibility |
Name |
Value Type |
Accessibility |
public |
DbType
|
DbType |
[ Get , Set ] |
public |
Direction
|
ParameterDirection |
[ Get , Set ] |
public |
IsNullable
|
Boolean |
[ Get , Set ] |
public |
OleDbType
|
OleDbType |
[ Get , Set ] |
public |
ParameterName
|
String |
[ Get , Set ] |
public |
Precision
|
Byte |
[ Get , Set ] |
public |
Scale
|
Byte |
[ Get , Set ] |
public |
Size
|
Int32 |
[ Get , Set ] |
public |
SourceColumn
|
String |
[ Get , Set ] |
public |
SourceColumnNullMapping
|
Boolean |
[ Get , Set ] |
public |
SourceVersion
|
DataRowVersion |
[ Get , Set ] |
public |
Value
|
Object |
[ Get , Set ] |
|
Parameter names are not case sensitive.
The following example initializes multiple instances of OleDbParameter through the OleDbParameterCollection within the OleDbDataAdapter. These parameters are used to select data from the data source and place the data in the DataSet. This example assumes that a DataSet and an OleDbDataAdapter have already been created with the appropriate schema, commands, and connection.
void AddOleDbParameters ( ) {
// ...
// create myDataSet and myDataAdapter
// ...
myDataAdapter.SelectCommand.Parameters.Add ( "@CategoryName",
OleDbType.VarChar, 80 ).Value = "toasters";
myDataAdapter.SelectCommand.Parameters.Add ( "@SerialNum",
OleDbType.Int ).Value = 239;
myDataAdapter.Fill ( myDataSet );
}
Public Sub AddOleDbParameters ( )
' ...
' create myDataSet and myDataAdapter
' ...
myDataAdapter.SelectCommand.Parameters.Add ( "@CategoryName", _
OleDbType.VarChar, 80 ).Value = "toasters"
myDataAdapter.SelectCommand.Parameters.Add ( "@SerialNum", _
OleDbType.Int ).Value = 239
myDataAdapter.Fill ( myDataSet )
End Sub |
|
C# |
VB |
OleDbParameterCollection OleDbCommand
|
|