Home All Groups Group Topic Archive Search About

Best practice mapping sql-tables to .net objects

Author
26 Jan 2007 11:01 AM
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

Author
28 Jan 2007 10:45 AM
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


Show quote
"aaapaul" <lvp***@gmx.net> schreef in bericht
news:1169809296.114408.40540@k78g2000cwa.googlegroups.com...
>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
>
Author
29 Jan 2007 4:09 PM
aaapaul
thanks to you all !

I found a good sample, too.

http://weblogs.asp.net/scottgu/archive/2006/01/15/435498.aspx

I will study this and if this works, I don´t need any wrapper tools.

aaaPaul

P.S.: I have to correct - I am new in programming .net, not basic
programming - I made some small tools with vb6

AddThis Social Bookmark Button