Name
OleDbType [OLE DB only]
Synopsis
OleDbType oleDbType = Parameter.OleDbType
Parameter.OleDbType = OleDbType
Specifies the OLE DB data type of the parameter, using the
OleDbType enumeration in the
System.Data.OleDb namespace. The value of the
Parameter is converted into this type before it is
passed to the data source. The default is a
DbType.VarWChar, a variable length string of
Unicode characters.
Example
The following code snippet sets the
Parameter.OleDbType property and then examines the
linked DbType. In this case, the linked
DbType value is DbType.Int32.
param.OleDbType = OleDbType.Integer; Console.WriteLine(param.DbType.ToString());
Notes
Every OleDbParameter class includes a
DbType property and a provider-specific
OleDbType property. These two properties are
linked. When you set the OleDbType property, the
DbType is adjusted to use a compatible type and
vice versa.
For more information about valid OLE DB data types and their mappings to .NET framework types, see Appendix A.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access