You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ParamDbType can be used to specify parameter DbType.
Param.cs
usingSystem;usingSystem.Data;usingNUnit.Framework;usingBLToolkit.Data;usingBLToolkit.DataAccess;namespaceHowTo.DataAccess{[TestFixture]publicclassParam{publicabstractclassTestAccessor:DataAccessor{[SqlQuery("SELECT {0} = {1} FROM Person WHERE PersonID = 1")]publicabstractvoidSelectJohn([ParamSize(50),ParamDbType(DbType.String)]outstringname,[Format]stringparamName,[Format]stringfieldName);}[Test]publicvoidAccessorTest(){using(DbManagerdb=newDbManager()){TestAccessorta=DataAccessor.CreateInstance<TestAccessor>(db);stringactualName;ta.SelectJohn(outactualName,"@name","FirstName");Assert.AreEqual("John",actualName);}}}}