Re: Some newbie questions

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi,

Let me first start with telling, what you don't ask by the way, that there
is not a best or even reaching that method. For reading one value from a
datatabase you can use as well the executescalar, for reading sequential by
instance for a report you can use too the datareader and than there is the
dataadapter.


> 1. For a simple database with a couple of tables do you create a
> dataadapter for each table and then create a dataset that includes each of
> these tables?
>
It is your own choise, both have its pro's and contra's. The designer create
standard for every dataset its own dataadapter, however you are free to use
one and replace everytime the selectcommand, the insertcommand, the
deletecommand and the updatecommand and use one. The last has not any
benefit above using more adapters.

> 2. Do you use the same adapters and datasets througout the application on
> different forms? If so how do you make them available to the other forms
> if
> you have used the wizard to create them?
>
As everything in Net is it again up to you. By instance when I need a
dataset and a selected dataset for by instance a combobox, than I make 2
datasets. One full in columns however few rows and one full(ore selected
with a where clause) and only 3 columns.

> 3. Is it best to reference rows/records by ID number in the table or the
> row index?
>
I don't know how to get records by ID number than by using a find. The last
consumes of course more time than using a row by index. If you mean the
item, than indexing using the column is the quickest.

> 4. Should you link tables in the database using views/queries in the
> database or by creating a separate datatable in the dataset that joins the
> tables from the database?

AFAIK is the relational information from the database not transported to the
dataset. You should create always seperatly your relations and therefore use
as much tables as there are relations.

> 5. Any other advice on best practices for learing this stuff.
>
Start your project with not using stored procedures, those you can implement
very simple forever (and do that) at the end from your project when you know
that everything is right

Use the designer at least to show you how it can be done. A good approach is
to do that not on a form, however in a seperated component that you have
added as item.

For the rest, try and learn from your errors, every sample or book starts to
learn you how to use it, for the rest is your situation the basic how you
make it. Otherwise a simple generator could do everything.

I hope this helps,

Cor


.



Relevant Pages

  • Update database using DataAdapter for DataSet populated from XML file?
    ... I have an XML file with data which I am reading into a dataset. ... I want to make changes to a table in my database based on values from the dataset. ... These changes can include updates, ... my dataset was not filled using the DataAdapter... ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: CommandBuilder
    ... CommandBuilder not create the SQL sentences of my DataAdapter (i.e. ... Can I make a SelectCommand without results (a Select query which returns 0 ... > DataAdapter knows what to do, and you must have a table in your database ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Application Speed Problem - VERY weird
    ... MDE front ends not MDB ... If the DB is reading in a lot of records, ... The data is linked with the standard Access "link ... add that we have only ever used the database on Access 2K. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Datasets - what is the best approach?
    ... I seem to still be struggling with the best place to declare the DataAdapter ... > I try to retrieve only the data that is currently relevant to the task at hand. ... Crystal report projects with master/detail type ... It accesses data in an SQL Server database. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help with calculations in a query
    ... Well, Richard, I'll tell you what I do know. ... I do know that I've tried various approaches to solving many database ... deletes the row containing the previous day's reading? ... Lets say that I created an extra field in my table for each meter ...
    (microsoft.public.access.queries)