0

I used to build data layer by using Classes, however someone suggest to use Strongly Typed DataSets because it's faster in development. The data layer that I'm going to build should support multi DBMS(Oracle,MSSQL, MySQL..).

how is better build it by using Strongly Typed DataSets or by using Classes?

Wael Dalloul
  • 22,172
  • 11
  • 48
  • 57
  • 3
    Why not use Entity Framework? It's a class structure generated from database with multi DBMS support (http://msdn.microsoft.com/en-us/data/dd363565.aspx) – HuBeZa Aug 17 '09 at 11:33
  • it seems that still no solution to connect Oracle to EF coming from Microsoft camp and all the other solutions are commercial or tests that you can't use in production environments – Wael Dalloul Aug 24 '09 at 07:54

3 Answers3

0

I made several big business applications using Strongly Typed DataSets. (Both for Oracle and MSSQL)

I like to work with Strongly Typed Datasets, and I will do it again next time. I think it is a BIG help that the columns are strongly typed in the C# and VB.NET code. But be aware that you will probably have to make your own functions for fill and sometimes for Update too. (based on where clause) For Oracle I used System.Data.OracleClient (I found this one was best for me)

Please note that for Oracle all numbers are converted to Decimal. (not smart for ID columns) And when you change SQL string in the TableAdapter it will overwrite your changes from Decimal to Int32. This can be very annoying, but when you get used to it, it is not a big problem.

thomas nn
  • 933
  • 3
  • 13
  • 21
  • 2
    Strongly typed datasets are nice, but the generated TableAdapters are awful... There is no easy way to change the connection string except change the app.config, so it can't be done by the program itself. And they are always generated for a specific DBMS, not using generic code :( – Thomas Levesque Aug 17 '09 at 11:45
0

I put it in a database table so when the business content changes (tables or fields) you don't have to re-compile the code.

It's a fundamentally different approach, however. It uses dynamic SQL internally (not based on any user input,) which makes some people nervous.

Beth
  • 9,531
  • 1
  • 24
  • 43
0

My preference is to implement classes for business logic, using an architecture such as CSLA. Data access logic can be included in the same classes, or factored out into separate classes or Data Sets. Using Data Sets for your business logic and directly binding them to UI is rather limiting.

JoshL
  • 10,737
  • 11
  • 55
  • 61