Filling a strongly-typed dataset using Data Access Application Block (DAAB) June2005 Version

B

Bart_Tubalinal

How do you fill a strongly typed dataset using the new version of DAAB? I
have seen examples written using DAAB v 2.0 but in that version, there's
an object SQLHelper with a method FillDataset(....). This SQLHelper object
does not exist in the current version.

Any help (and example code) would be appreciated. Thanks.
 
W

W.G. Ryan MVP

Bart.. just to be sure, you are asking about the new Enterprise Library (June) block right? If so, there's a LoadDataSet method that takes a stored proc, dataset, tablename and param values... since a typed dataset is a dataset, you can pass it in and as long as the table name matches, you'll be good to go.(I wrote this about the previous version but the same principles apply http://www.knowdotnet.com/articles/typeddataset.html) Anyway, the LoadDataSet method should work for you here just like FillDataSet did previously.

Cheers,

Bill

How do you fill a strongly typed dataset using the new version of DAAB? I have seen examples written using DAAB v 2.0 but in that version, there's an object SQLHelper with a method FillDataset(....). This SQLHelper object does not exist in the current version.

Any help (and example code) would be appreciated. Thanks.
 
W

W.G. Ryan MVP

Bart - one other thing I forgot to mention... The Application blocks are pretty flexible and can do a lot for you out of the box, but there's a section in the documentation of each block on extending them (ms-help://ms.EntLib.2005Jun/ms.EntLib.2005Jun.Da/DataAccess/Extending%20the%20Data%20Access%20Block/03-Modifying%20the%20Data%20Access%20Application%20Block.htm) As such, if you find that the default functionality doesn't meet your needs, rolling your own methods is the way to go. The nice part is that you can just follow the design template already there and run with it. For instance, adding asynchronous BeginLoadDataSet, BeginExecuteScalar, or ExecuteScalarTransaction [adding transactional processing there] is stuff that is really easy to implement and it makes the block way more useful (after all, synchronous database access can be a real stinker in many instances).

I'm working on the code for the above referenced methods right now and should have it ready in a day or two (at least for the Sql and Oracle classes).. drop me a line at WilliamRyan AT Gmail Dot Com and I'll gladly shoot you the code when I have it done if you're interested.

Cheers,

Bill

How do you fill a strongly typed dataset using the new version of DAAB? I have seen examples written using DAAB v 2.0 but in that version, there's an object SQLHelper with a method FillDataset(....). This SQLHelper object does not exist in the current version.

Any help (and example code) would be appreciated. Thanks.
 
B

Bart_Tubalinal

Hi Bill,

Thanks for the response. I haven't had a chance to test out what you said
about the LoadDataSet method (I've been pulled into other projects) but I
did read the documentation for it and it looks like it's exactly what I
was looking for. I have no idea why I didn't find it earlier.

Regarding extending the Application Blocks, I haven't really looked into
that because they provided me with the needed functionality before but the
asynchronous methods you mentioned has piqued my interest. Those sound
like really helpful methods to have in the DAAB. Are you going to release
that code at some point?

Also, I was on the Microsoft Enterprise Library Home and saw that there's
a Data Mapping Application Block. Have you, by chance, had an opportunity
to test that? Before I saw it, I was contemplating on whether to write my
own Data Mapping layer but I think I'm going to test this one out first,
before I try to create my own.

BXT
 
G

Guest

Please fell free to check out the Data Mapping Block. I wrote it. I'd be
happy to hear your thoughts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top