Re: Programming databases in .NET - please help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



<lennon1@xxxxxxxxxxxx> wrote in message
news:1142775347.013030.193600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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

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

Thanks
Jethroelp



.



Relevant Pages

  • Re: The Zen nature of a Delphi database application
    ... Only those needed for display or locating purposes. ... What's drawing me to databases specifically is the ability to store ... I've been trying to figure out if I can abstract out the storage ... If you don't need polymorphism, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Best way of developing simple PPC apps for Unix types?
    ... It will read standard comma-delimited files. ... then export databases to my cell phone. ... a small barcode scanner. ... display data in a tabular form, allow selection of an item and display ...
    (microsoft.public.pocketpc.developer)
  • Callback Function
    ... I created a from that I want to display all the databases ... would display the databases reports. ... lngRow As Long, lngCol As Long, intCode As Integer) As ...
    (microsoft.public.access.forms)
  • Re: VB6 Login Form to SQL Server
    ... do with errors being displayed before the recordset is returned. ... >> I've decided that I do not wish to use DMO at this time to display a list ... >> blank until the user supplies a valid servername, username, and password. ... >> the list of databases on the server... ...
    (microsoft.public.vb.database)
  • Re: VB6 Login Form to SQL Server
    ... do with errors being displayed before the recordset is returned. ... >> I've decided that I do not wish to use DMO at this time to display a list ... >> blank until the user supplies a valid servername, username, and password. ... >> the list of databases on the server... ...
    (microsoft.public.vb.database.ado)