Programming databases in .NET - please help

L

lennon1

Hi, I have already started learning .NET and I have a question. If I
want to do anything - Display Data, Navigate, Update - with database
(SQL Server) in Visual Studio 2005, do I have to use all this objects :
- DATASET
- sqlDataAdapter
- BindingSource
- sqlConnection

I usually write database applications in Delphi, but now I want to
learn Dot Net platform ant it's quite diffrent than programming
databases in Delphi. Besides I want to make sure that the code I write
is correct.

Please help me. If you know some good links or discussion group about
programming databases in .NET please give me some.

Thanks
Jethroelp
 
P

pvdg42

Hi, I have already started learning .NET and I have a question. If I
want to do anything - Display Data, Navigate, Update - with database
(SQL Server) in Visual Studio 2005, do I have to use all this objects :
- DATASET
- sqlDataAdapter
- BindingSource
- sqlConnection

I usually write database applications in Delphi, but now I want to
learn Dot Net platform ant it's quite diffrent than programming
databases in Delphi. Besides I want to make sure that the code I write
is correct.

Please help me. If you know some good links or discussion group about
programming databases in .NET please give me some.

Thanks
Jethroelp
Here are a couple of links to get you started...

http://www.codeproject.com/script/comments/forums.asp?forumid=1725

http://msdn.microsoft.com/data/dataaccess/whidbey/

http://msdn.microsoft.com/vbasic/previous/2003/using/data/default.aspx

There is also a public newsgroup:

microsoft.public.dotnet.framework.adonet
 
S

SP

Hi, I have already started learning .NET and I have a question. If I
want to do anything - Display Data, Navigate, Update - with database
(SQL Server) in Visual Studio 2005, do I have to use all this objects :
- DATASET
- sqlDataAdapter
- BindingSource
- sqlConnection

You will need to connect to your database, get the data records, put these
data records in some form of "container" and then display this container.
SqlConnection is what you use to connect to your SQL Server database. If you
might use different databases down the road then program against the
IDbConnection interface rather than the concrete SqlConnection class.

You get the data via a data adpater or a data reader. Data adapters are used
with a dataset, datareaders are generally used with a collection of objects.
For a simple CRUD application (create, read, update, display) then datasets
are popular. If you want to build a business object model then you will use
business classes and collections and populate these collections via the data
reader. Again program against the interfaces not the concrete classes if you
might support different databases, i.e. IDbReader

All list type controls pretty much work with datasets. Collection support is
generally based on vendor supporting certain interfaces like IList. My
experience is that vendors fully support datasets in terms of their "data
awareness" but that collections may require you to implement additonal
interfaces in order to be fully "data aware", e.g. ITypedList. One example
is that adding an item to a collection may require you to tell the list
control to "refresh" in order to see the item but with datasets adding a
datarow to a datatable is all that is needed for the new row to be
"automatically" displayed.
I usually write database applications in Delphi, but now I want to
learn Dot Net platform ant it's quite diffrent than programming
databases in Delphi. Besides I want to make sure that the code I write
is correct.

The most important decision I believe is datasets versus collections. I
myself always use collections and I feel they work with the OO model better.

HTH

SP
 
L

lennon1

Thank you very much for this post - it's very interesting. Well, I must
admit that collection is something new for me, but I know what it is
and how use it, but i I've never used it in my work while programming
in Delphi. Can you give some more advices about started programming
databases in .NET ? I'm going to use C#.

Jethroelp
 
S

SP

Thank you very much for this post - it's very interesting. Well, I must
admit that collection is something new for me, but I know what it is
and how use it, but i I've never used it in my work while programming
in Delphi. Can you give some more advices about started programming
databases in .NET ? I'm going to use C#.

As you are starting something new then I would like at using a persistence
framework / OR mapper. These tools handle a lot of the mundane and
repetitive coding that deals with the creation of objects from data in your
database and the persistence of your objects to your database.

Also I would move away from thinking about your application as database
programming. Most applications persist data but I wouldn't call them
database applications.

SP
 
T

topgene

i don't think that a coders couldn't user the google.

hi,boy,just input 'ado.net' and submit it at google's homepage.

good luck
 

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