locked
No overload for method 'Add' takes '3' arguments RRS feed

  • Question

  • User1982844092 posted
    For some reason, I don't know if maybe I'm just not using the right method for the adding of parameters, but I get this error during the build:

    No overload for method 'Add' takes '3' arguments            

    Should I be using Add here?  I did see using dbCommandWrapper.AddInParameter here but I do'nt think that's a valid method in Enterprise Library 2.0:
    http://aspalliance.com/688

    Part of my code:


    ....some code before
    Database db = DatabaseFactory.CreateDatabase();

                 DbCommand dbCommandWrapper = db.GetStoredProcCommand("MyStoredProcHere");

                //Stored procedure input parameters
                dbCommandWrapper.Parameters.Add("@SearchTerm", DbType.String, SearchTerm);
                dbCommandWrapper.Parameters.Add("@CreateDate", DbType.DateTime, DateTime.Now);
                dbCommandWrapper.Parameters.Add("@ResultCount", DbType.DateTime, 1);

                // Execute Stored Procedure to insert Search Term into table
                db.ExecuteNonQuery(dbCommandWrapper);
    ....rest of code
    Tuesday, July 25, 2006 2:01 PM

All replies

  • User-626170296 posted
    I have used AddInParameter with Enterprise Lib2.0 and it works prefectly fine. I think you should give it a try.
    Wednesday, July 26, 2006 11:27 AM