Ado.net basic questions

  • Thread starter Thread starter JH
  • Start date Start date
J

JH

In my application which connects to a database with three tables dynamically
1. Is it necessary to have more than one connection string every time I
create a dataset?
2. Is it recommended to use more than one data adapter each time I query to
form a dataset?
3. when do you close a connection?

Newbie here
 
* "JH said:
In my application which connects to a database with three tables dynamically
1. Is it necessary to have more than one connection string every time I
create a dataset?
2. Is it recommended to use more than one data adapter each time I query to
form a dataset?
3. when do you close a connection?

I recommend posting questions like this to the ADO.NET group:

..NET Database group:

<
Web interface:

<http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>
 
Hi JH,

In my application which connects to a database with three tables dynamically
1. Is it necessary to have more than one connection string every time I
create a dataset?
No

2. Is it recommended to use more than one data adapter each time I query to
form a dataset?
No, but you needs everytime to add the right command so in my opinion is
the most simple to use one and to renew it everytime.

3. when do you close a connection?
When you have opened it and that is not always necessary. With a dataadapter
and one datataset (or beter datatable) it is recomended not to do open that
because the connection is automaticly opened and closed, with more tables it
is recommended to open it every time before the action and keep it open
untill all dataadapter functions are done for a dataset and than close it
again.

I hope this helps,

Cor
 
Back
Top