20.1 CommentsTroubleshooting

20.1 Comments/Troubleshooting

All Parameter objects implement the IDbDataParameter and IDataParameter interfaces from the System.Data namespace, and are thus quite similar. Because IDbDataParameter extends IDataParameter , you can use the IDataParameter to access all functionality when writing provider- agnostic data access code.

Provider-specific Parameter objects typically add a property that defines a database-specific data type for the parameter. Some Parameter classes for ADO.NET providers are shown in Table 20-1.

Table 20-1. Provider-specific Parameter classes

Class

Data source

 System.Data.SqlClient.SqlParameter 

SQL Server

 System.Data.OleDb.OleDbParameter 

An OLE DB provider

 System.Data.Odbc.OdbcParameter 

An ODBC driver

 System.Data.OleDb.OracleParameter 

Oracle



ADO. NET in a Nutshell
ADO.NET in a Nutshell
ISBN: 0596003617
EAN: 2147483647
Year: 2005
Pages: 415

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net