Best practice mapping sql-tables to .net objects

A

aaapaul

I am quite new in programming an I have to develop an application
(Project-Management-Software) with Visual Studio .NET 2005 and SQL
Server 2005 (ADO.NET).

My problem is how to map the sql-server table to the .NET Object/class!

Does it make sense to use typed datasets or is it better to create a
class with a variable (property) for each column of the table.

Who has any experience in such affairs?

Perhaps there is a sample application available on the web ...
(database application - windows forms)

Thanks
aaapaul
 
E

Earl

Microsoft did all that for you, it's called a strongly-typed dataset. You
should buy some books to get started, otherwise you'll use quadruple the
time online trying to dig up all the resources.

I question the judgment of someone who would commission you to create an
application with no experience at all -- it's hard enough when you have a
clue as to what's going on. Good luck.
 
M

Miha Markic [MVP C#]

I would use an Object Relational Mapper product, LLBLGenPro recommended.
And as Earl said, good luck.
 
W

William \(Bill\) Vaughn

I agree. While my book does not delve into the OR mapping paradigm, Rocky
Lhotka wrote a couple as did Deborah Korata.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
 
R

RobinS

And Deborah Kurata has a new book coming out in March,
"Doing Objects in VB2005". I read it, and it really helped
me understand how to implement the n-layer paradigm.

It shows how to set up your classes, then use databinding
to show the data on the screen, and how to create a Data
Access Layer to do the updates.

Robin S.
----------------------------------
 
R

Robbe Morris [C# MVP]

I prefer to use my own custom built object mapper.
The source code is available via the link below:

--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
 
C

Cor Ligthert [MVP]

AaaPaul,

I would in your way first look if the ADONET methods fixes your problem
before you start using methods invented in the past before the invention of
the so well to use Strongly Typed DataSets (XSD) on SQL type databases.

Here is a simple sample how to start with it, it takes 10 minutes and uses
completely the DataAdapter, the you can say now standarised Dataset with its
DataTable idea instead of creating all kind of free style dataobjects.

http://www.vb-tips.com/dbpages.aspx?ID=1139f14a-c236-4ad7-8882-b1ed16424252

(I know that I get now a lot of comments).

For books around this, obviously without that I have read them, David Sceppa
and William Vaughn.

Cor
 

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