How many connections to access 2000 in asp.net are allowed?

N

Nick

hi,
It seems that I only can have one connection to access 2000 in asp.net.
When I tried to new another one, it says Could not use, file is already
in use.
So, there is no way to create more than one connection to access 2000?

thanks.
 
T

Tim_Mac

hi Nick,
i use access 2000 in lots of my asp.net projects. some of the sites are
quite busy, with many users logged on at the same time doing lots of
database hits.
if you are deliberately trying to use two different connection objects, can
i ask why? you can use the same connection object for different commands.
it saves on memory and processing to use only one. i've never had occasion
to open 2 connections in the same code block.

otherwise, it is probably some code that isn't closing an OleDb connection
properly. try posting your code here and we'll see take a look at it for
problems.

hope this helps
tim
 
N

Nick

Thanks Tim.
I was just thinking, becuase currently, our project use sql server
2000, and there is some code like this:
con1 = .....
......
while(rd1.Read())
{
//Get the record from this datareader
int nID = ......
// Create new query with nID and update another table, here it is
using another connection,
SqlCommand cmd = new SqlCommand(strNewQuery, con2);
.......
}

Yes, i think for this code, it should not be hard to find another way
to work around.
Thanks.
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top