Enterprise Library 2.0 -- DataAccess block
I played a little bit with entlib 2.0 today. Good news is that DbCommandWrapper class is obsolete. Database class works now directly with System.Data.Common.DbCommand class. Instead of:
Database db = DatabaseFactory.CreateDatabase("MyDB"); string procName = "MyPROC"; DBCommandWrapper dbc = db.GetStoredProcCommandWrapper(procName); dbc.AddInParameter("@myParam", DbType.String, myParam);
We now can write:
Database db = DatabaseFactory.CreateDatabase("MyDB"); string procName = "MyPROC"; DbCommand dbCommand = db.GetStoredProcCommand(procName); db.AddInParameter(dbCommand, "@myParam", DbType.String, myParam);
What I don't like is the fact that you can not specify the size of the parameter inside AddInParameter in the normal way as you can do in AddOutParameter (the same behaviour exists in Entrperise Library 1.0). Because of this - DataAccess block passes the max size of the specified DbType and performance sucks.
Thursday, February 16, 2006 1:57 AM