V
Venkat
Hi,
We have a windows application developed in c# and SQL Server 2005. Our
application need to execute more than one command (ExecuteReader and
ExecuteScalar) at a single time. Till now we have we use with only one
connection created during start up of application and will be
displose/closed when user logs out of application. With the single database
connection we have problems when trying to execute more than command at a
particular time.
Can you tell me the best practice to solve this problem? I am thinking the
following ways
1) Is it better to open and close connection whenever we need to execute a
command? But the problem with this is the Sql server runs on a network
server and it is taking much time to establish/create a database connection.
2) By using Connection pool. I am thinking to have a connection pool with
minimum connections of 1 and maximum connections as 5. But I read some
articles that connection pooling is generally used in web applications. I am
not sure whether it is helpful for windows based application or not.
Please suggest me the best practice to solve my problem.
Thanks in advance.
Srikanth
We have a windows application developed in c# and SQL Server 2005. Our
application need to execute more than one command (ExecuteReader and
ExecuteScalar) at a single time. Till now we have we use with only one
connection created during start up of application and will be
displose/closed when user logs out of application. With the single database
connection we have problems when trying to execute more than command at a
particular time.
Can you tell me the best practice to solve this problem? I am thinking the
following ways
1) Is it better to open and close connection whenever we need to execute a
command? But the problem with this is the Sql server runs on a network
server and it is taking much time to establish/create a database connection.
2) By using Connection pool. I am thinking to have a connection pool with
minimum connections of 1 and maximum connections as 5. But I read some
articles that connection pooling is generally used in web applications. I am
not sure whether it is helpful for windows based application or not.
Please suggest me the best practice to solve my problem.
Thanks in advance.
Srikanth