Strongly Typed Dataset should be in DataAccess Layer or Business Layer

  • Thread starter kittipong.kiatcheeranun
  • Start date
K

kittipong.kiatcheeranun

I am not exactly sure that my understanding is right or wrong. In
strongly typed dataset we can generate all of the fields from tables
in database and also has tableadapter that allow us to write down sql
command in or directly link to table. We still can write the code in
dataset partial class for validating data as well.
As far as I understand strongly typed dataset is in both of Business
layer and data access layer, isn't it? Because validation rules code
and all datatable's fields should be in business layer and
tableadapter which is tied to sql command and connection string should
be in data access layer. Is this right or wrong? Any suggestion or
does it have any best way if I want to use strongly typed dataset in
my project.
 
M

Miha Markic

Your assumptions are correct.
There are at least two alternatives:
- forget about datasets at all and go with ORM (object relational mapping).
There is a plenty of products out there (I am particulary keen to
LLBLGenPro)
- avoid using table adapters in the same assembly
- you could create them using a template based code generation approach
(i.e. CodeSmith)

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand

I am not exactly sure that my understanding is right or wrong. In
strongly typed dataset we can generate all of the fields from tables
in database and also has tableadapter that allow us to write down sql
command in or directly link to table. We still can write the code in
dataset partial class for validating data as well.
As far as I understand strongly typed dataset is in both of Business
layer and data access layer, isn't it? Because validation rules code
and all datatable's fields should be in business layer and
tableadapter which is tied to sql command and connection string should
be in data access layer. Is this right or wrong? Any suggestion or
does it have any best way if I want to use strongly typed dataset in
my project.
/
 

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