Hi,
To be indepentend from the data provider, I wrote a DataLayer. This datalayer has a GenericParameter class which inherits IDataParameter. When I use a Sql Provider, then I need to convert the DbType to SqlDbType like this: (SqlDbType)param.DbType . But it converts the types completly wrong. E.g.: DbType.Int32 -> SqlDbType.NText and DbType.String -> SqlDbType.BigInt ! Does someone knows what I should do
Thanks, Rainer.

DB Type casting
frusciante
What you want is the following:
SqlParameter param = new SqlParameter();
param.DbType = myGenericDbParameter.DbType;
The DbType and SqlDbType are linked, so if you set the DbType it will automatically update the SqlDbType as appropriate.