Anatoly Lubarsky

Logo
MSSQL, .NET, Design. Life and Music

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.


Related Posts:

Thursday, February 16, 2006 1:57 AM

Comments

# re: Enterprise Library 2.0 -- DataAccess block
Yep, and working with blobs is a pain ...

2/16/2006 1:26 PM by AlexB

# re: Enterprise Library 2.0 -- DataAccess block
Surely you can just change the Entlib code to be how you want it and recompile? Isn't that the point of having the source code?

If you didn't you'd probably create your own wrapper classes similar to the Entlib anyway?

9/27/2006 1:12 AM by somebody

# re: Enterprise Library 2.0 -- DataAccess block
2 somebody:
Sure I can create my own wrapper class around SqlCommand class in this case instead of DataAccess application block.

Recompiling Entlib is the pain in the ass, imho. After the following release you should again change and recompile.

9/27/2006 1:25 AM by Anatoly Lubarsky

If your feedback doesn't appear right away, please be patient as it may take a few minutes to publish.

Post a Comment

Protected by CAPTCHAEnter the code you see
Name (*)  
E-mail (*)  
Url
Remember

Comment (*)