AddParameter method for sqlServer TEXT field type RRS feed

  • Question

  • User85464057 posted


    Normally I use the following method to add parameters:

    oDb = DatabaseFactory.CreateDatabase();
    oCmd = oDb.GetStoredProcCommand( "usp_someSproc" ); 
    oDb.AddInParameter( oCmd, "@someField", DbType.String, pDesc );
    oDr = oDb.ExecuteReader( oCmd );

    Works fine, considering that @someField is a varchar field in the DB. BUT in case @someField is a TEXT field in the DB, if
    I still use oDb.AddInParameter( oCmd, "@someField", DbType.String, pDesc ); it will work for small amounts of text, but for
    real long text I need a DbType.TEXT which I don´t have through the AddInParameter way ...

    Would someone post a code sample on how to add parameters for the Text field in sql server?


    Thursday, February 22, 2007 7:21 PM

All replies