[quoted text, click to view] "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:urZu%23PGkHHA.1624@TK2MSFTNGP02.phx.gbl...
> 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
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.
[quoted text, click to view] >
>> 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.
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)
--
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/