What is the max number of tables advised to use with typed datasets?

B

Brooke

I am helping develop a SQL Server 2005 application with a C# front-end.
Originally I was using untyped datasets and stored procedures and it worked
fine. Now I have been told to used typed datasets and table adapters. Is
it a good idea to use typed datasets on a database with about 25 tables?

Typed datasets are much easier in some aspects, but I am finding it
difficult to change certain things without the application blowing up, and
it takes a lot of effort to maintain the typed datasets if the underlying
SQL Server database structure changes (new fields, renamed fields, new
constraints, etc.).

Any suggestions or opinions would be greatly appreciated.

Thanks
 
C

Cor Ligthert [MVP]

Brooke,

Inline
I am helping develop a SQL Server 2005 application with a C# front-end.
Originally I was using untyped datasets and stored procedures and it worked
fine. Now I have been told to used typed datasets and table adapters. Is
it a good idea to use typed datasets on a database with about 25 tables?
Should not be any problem
Typed datasets are much easier in some aspects, but I am finding it
difficult to change certain things without the application blowing up, and
it takes a lot of effort to maintain the typed datasets if the underlying
SQL Server database structure changes (new fields, renamed fields, new
constraints, etc.).
Here are typed datasets even better because you are direct told that there
is a problem by only one time building your project.

Just my thought,

Cor
 
M

Miha Markic

Cor Ligthert said:
Brooke,

Inline

Should not be any problem

Yep, there is no limitation. But note, that you can create multiple
datasets, each one per problem domain.
IOW you are not forced to have one gigantic typed dataset, I would vota
against such approach.
Here are typed datasets even better because you are direct told that there
is a problem by only one time building your project.

Cor is right, but only if you modify typed dataset. Let's say you have
changed column name in database. Next you have to find all occurrences in
your typed datasets and change columns accordingly. Only then, you'll get
compile time errors where you were using the old column name, and this is
good - you'll catch errors asap.
You are also right that keeping typed datasets in sync with database is an
effort. There are a couple of solutions, though:
a) create typed datasets using some sort of generator (there are some
generators out there, both free and commercial, CodeSmith (commercial)
highly recommended)
b) forget classic ado.net approach and switch to an ORM approach (there is
plenty of ORMs out there, both free and commercial, LLBLGenPro (commercial)
highly recommened)
 

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