473,883 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Executerea der requires an open and available connection" error


I have an asp.net page that stopped running properly giving the error
below. The app uses a SQL Server 2000 on another server. Enterprise Manager
and Query analyzer on the web server can connect to that sql server just
fine and run queries. I rebooted the web server and made aspnet member of
the admin group. I don't know why the error mentions open connections if I
can open several query anaylzer windows using the same sql server
credentials as the asp.net is using.
I suspect it's an issue with ado.net or .net in general.

Any ideas?

error message:
"Executerea der requires an open and available connection

Karim
Nov 17 '05 #1
6 4505
Whoa - don't go adding ASPNET to the admins group - that's a huge security
vulnerability!

First of all, you'll want to check your authentication. You can't use a
local account to use windows authentication to another machine - either use
a domain account or else use SQL Authentication (a domain account being the
more secure option, but if you have to use SQL authentication you can at
least encrypt your key using aspnet_setreg). Once you have that going, then
make sure you wrap the opening of your database connection in a try catch
block, and examine the error message that you receive for more information:

try {
conn.Open();
} catch (SqlException ex) {
#if (DEBUG)
Response.Write( ex.Message);
#else
// do something to handle the error in release mode that doesn't give
potential hackers too much info
#endif
} finally {
// do any cleanup
}
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
"karim" <ka*******@11ya hoo11.com> wrote in message
news:1w******** *************** ******@40tude.n et...

I have an asp.net page that stopped running properly giving the error
below. The app uses a SQL Server 2000 on another server. Enterprise Manager and Query analyzer on the web server can connect to that sql server just
fine and run queries. I rebooted the web server and made aspnet member of
the admin group. I don't know why the error mentions open connections if I can open several query anaylzer windows using the same sql server
credentials as the asp.net is using.
I suspect it's an issue with ado.net or .net in general.

Any ideas?

error message:
"Executerea der requires an open and available connection

Karim

Nov 17 '05 #2
It's saying that the datareader was closed in your code.

To use a datareader you:

1) declare a connection to the sql server
2) open that connection
3) execute the datareader
4) close the datareader

If your looping your code and trying to read a second time after the
connection is closed you would see this error.

Another possibility is if you put the connection object into an application
level variable, then while one user trys to open a connection another might
be closing it at the same time. In both cases you would see this error.

Or maybe you just forgot to open your connection.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"karim" <ka*******@11ya hoo11.com> wrote in message
news:1w******** *************** ******@40tude.n et...

I have an asp.net page that stopped running properly giving the error
below. The app uses a SQL Server 2000 on another server. Enterprise Manager and Query analyzer on the web server can connect to that sql server just
fine and run queries. I rebooted the web server and made aspnet member of
the admin group. I don't know why the error mentions open connections if I can open several query anaylzer windows using the same sql server
credentials as the asp.net is using.
I suspect it's an issue with ado.net or .net in general.

Any ideas?

error message:
"Executerea der requires an open and available connection

Karim

Nov 17 '05 #3
On Wed, 13 Aug 2003 12:42:50 -0400, Chris Jackson wrote:
Whoa - don't go adding ASPNET to the admins group - that's a huge security
vulnerability!
I understand the implications. I am trying to troubleshoot. Plus the server
is an internal server.

First of all, you'll want to check your authentication. You can't use a
local account to use windows authentication to another machine - either use
a domain account or else use SQL Authentication (a domain account being the
more secure option, but if you have to use SQL authentication you can at
least encrypt your key using aspnet_setreg). Once you have that going, then
make sure you wrap the opening of your database connection in a try catch
block, and examine the error message that you receive for more information:

try {
conn.Open();
} catch (SqlException ex) {
#if (DEBUG)
Response.Write( ex.Message);
#else
// do something to handle the error in release mode that doesn't give
potential hackers too much info
#endif
} finally {
// do any cleanup
}


I am using sql authentication and the app used to work. The sql
authentication works as verified by using query analyzer.

karim
Nov 17 '05 #4
On Wed, 13 Aug 2003 11:47:55 -0500, S. Justin Gengo wrote:
It's saying that the datareader was closed in your code.

To use a datareader you:

1) declare a connection to the sql server
2) open that connection
3) execute the datareader
4) close the datareader

If your looping your code and trying to read a second time after the
connection is closed you would see this error.

Another possibility is if you put the connection object into an application
level variable, then while one user trys to open a connection another might
be closing it at the same time. In both cases you would see this error.

Or maybe you just forgot to open your connection.

Sincerely,


It's not the code. It used to work fine plus it works fine on my
development box connecting to the same sql server using the same sql
credentials. I recompiled and replaced the dll on the production box. Same
problem.

It has to be something in Windows or .net, a setting, permission or
something.

karim
Nov 17 '05 #5
> I am using sql authentication and the app used to work. The sql
authentication works as verified by using query analyzer.


The only thing I can think of is to step through your code. Make sure that
all of our code is being called as you expect. After you open the
connection, check it's state before stepping through the next line, etc.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
Nov 17 '05 #6
On Wed, 13 Aug 2003 09:26:15 -0700, karim wrote:

I have an asp.net page that stopped running properly giving the error
below. The app uses a SQL Server 2000 on another server. Enterprise Manager
and Query analyzer on the web server can connect to that sql server just
fine and run queries. I rebooted the web server and made aspnet member of
the admin group. I don't know why the error mentions open connections if I
can open several query anaylzer windows using the same sql server
credentials as the asp.net is using.
I suspect it's an issue with ado.net or .net in general.

Any ideas?

error message:
"Executerea der requires an open and available connection


I solved the problem but the I still need to know why my steps solved it.

The firewall log on the web server indicated SMB authentication errors to
the database server. The app used to work fine and nothing has changed
(afaik) and the firewall log hinted on permission or access problems. So I
changed the smpt, iis and iis admin services to run under the domain
administrator. The app worked! But I didn't want to keep this so I changed
them back to LocalSystem, restarted the services and it still worked. I
don't understand why all this made it happen. I appreicate any feedback.

karim
Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
18464
by: BGS | last post by:
I have a web site (www.on-the-matrix.com) that displays photos in a "slide show" format on ASPX pages that run in an inline frame on an ASP page (or in a separate pop-up window). The ASPX pages use a hidden form to transmit information back to the server so it will know which is the next photo to load. All of this works as intended in modern versions of Internet Explorer, Netscape and Mozilla. With Opera, however, users receive a...
1
1797
by: Lauchlan M | last post by:
I get the following error. Apart from the fact that it does not make any grammatical sense, what would be likely to be causing it? The background is that nxCmdDeleteErrorLogItem is a delete command with the SQL Delete from ErrorLog where LogID = ? and LogID is a parameter corresponding to a DB field LogID which is an autoinc field (the parameter is set at Int32).
1
1404
by: Lauchlan M | last post by:
I get the following error. Apart from the fact that it does not make any grammatical sense, what would be likely to be causing it? I have a command component 'nxCmdDeleteErrorLogItem' with the following SQL: Delete from ErrorLog where LogID = ? LogID is a parameter corresponding to a DB field LogID which is an autoinc field (the parameter is set at Int32).
3
2260
by: ITP | last post by:
Hello, I'm seeing this with the ADO.NET SQLClient provider: When I check the connection's open status after it has been opened AND has been broken (I simulate this by disconnecting the cable or by stopping SQL Server), the status returned is "true" or that it is open. The connection status of "broken" is not currently supported and therefore does not work either.
1
25118
by: Charlie | last post by:
I am trying to make an XMLHttpRequest which violates the default "same- origin"policy in Firefox. I checked the archives and found a method that should work but it does not. Below is the test code I isolated. I set signed.applets.codebase_principal_support true and seemed to get the UniversalBrowserRead permission but then the open still failed with the same old "Permission denied to call method XMLHttpRequest.open" error. Can someone tell...
2
17891
by: Martin Z | last post by:
I'm using the TableAdapterHelper to set the connection and transaction properties on all the commands of all my typed table adapters.... I've checked at the time of the error and all the commands have their Transaction property set. But I still get this error when I call... documentTA.Update(documentDS.Document); "ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local...
0
2684
by: Ofelia | last post by:
Hi, I'm new to this forum and to Perl language but I would like to ask for your help. I'm working in Linux and the files I need to process are in the format “file.gz”. I created a script which should decompress, open and then delete nearly 400 files. To do so I use "open FILEPT, "zcat $filename|"". In the beginning the script works fine, but after about 300 files processed I get an error on Open function: “proc: Could not open file...
8
5093
jmoudy77
by: jmoudy77 | last post by:
Hi, I've got a form that allows a user to imput their flight data. I programmed a MsgBox into the save button that asks if the user wants to input another duty position for the flight. If no, the record saves and the formresets for the next rocord input. If yes, the record is saved and the duty position and mode of flight fields are set to null, with the remainder of the fields retaining the data already entered. The problem is that...
0
10749
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10419
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9577
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7974
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5801
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4618
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3236
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.