Name

CreateParameter

Synopsis


IDbDataParameter param = Command.CreateParameter();

Returns a strongly typed provider-specific IDbDataParameter object. This method is primarily useful if you are writing generic code because it doesn’t force you to explicitly differentiate your code based on the type of Parameter object. However, this approach can be restrictive because it prevents you from using data types that may be specific to your data source (you must use the closest type from the System.Data.DbType enumeration instead). Also, unlike the Parameter object constructors and the ParameterCollection.Add() method, the CreateParameter( ) method doesn’t accept any parameters, which means that you need to specify the name, data type, length, and so on, using separate property set statements.