Skip to content
Advertisement

Missing AddWithValue from DbCommand.Parameters

I am building an sqlwrapper to handle both MSsql and Sqlite, I have no issues using the generic dbconnection, dataset and dataadapter so far, but with dbcommand parameters.add is the only option. I’d like to use parameter.addwithvalue like sqlcommand and sqlitecommand have, but I am unsure how to implement it.

For example here is my sqlitefactory:

Here is my implementation:

in the more specific sqlcommand and sqlitecommand there is a method .addwithvalue() which is what I’d like to have in the parent dbcommand class.

Advertisement

Answer

Solved it with and extension method

from http://social.msdn.microsoft.com/Forums/en-US/d56a4710-3fd1-4039-a0d9-c4c6bd1cd22e/dbcommand-parameters-collection-missing-addwithvalue-method

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement