SqlCommand comm = new SqlCommand("SELECT [Greeting] FROM [Misc]", conn);
try
{
conn.Open();
}
catch
{
Response.Write("Error opening connection in Page_Load of default.aspx to retrieve the greetings");
}
string MyGreet = (string)comm.ExecuteScalar();
Greetings.Text = MyGreet;
try
{
conn.Close();
}
catch
{
Response.Write("Error closing connection in Page_Load of default.aspx after retrieving the greetings");
}
}
When it gests to conn.Open() in the debugging mode I see that the ServerVersion = 'conn.ServerVersion' threw an exception of type 'System.InvalidOperationException'.
The most interesting thing is that it used to work before.
As I said it used to work, but one day I tried to access the web site and it said this error that I get, that the connection is closed. Then I was using the SQL Server Express. When in the Visual studio if I would run this same site in debug, everything was working fine. I decided to uninstall the SQL Express and installed the SQL Server.
If I open the SQL Server Managment Studio in the Server name field I see MDM1(this is the name of the PC, but probably it is the same name for the Server. Well, in the MAnagment Studio it conects fine to the MDM1 so it is no probably the naming problem. Ithink it has something to do with permisssions.
I am accessing SQL2005 with C# code using OleDbConnection.
A try and catch block catches the following error once a while between the Open() and Close() of the connection:
ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
I do not even have any idea where to start to debug this. The ExecuteNonQuery() runs a delete SQL query. It works 99.9% of the time. I do not see anything wrong when this error happens.
The application server gets below error while the job is being run intermittently:
An error occurred while performing connection management
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. Â at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171) Â at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:319) Â at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:1839)
I am using MS JDBC driver 2005 1.2 and in-house written connection pooling that was working fine for a number of years. This combination worked OK with SQLserver 2000. But recently we switched to SQLServer 2005 (x64) on WIN Server 2003 Standard x64 eddition. Everything seems work OK during business hours, however, after business hours when there are lesser users and connection stays idle for sometime, I am getting the following error: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.setAutoCommit(Unknown Source) at com.nms.serverframework.dbaccess.OnlineTransactionManager.freeConnection(OnlineTransactionManager.java:420) at com.nms.serverframework.dbaccess.OnlineTransactionManager.releaseConnection(OnlineTransactionManager.java:707) at com.nms.serverframework.dbaccess.OnlineTransactionManager.releaseConnection(OnlineTransactionManager.java:688) at com.nms.serverframework.dbaccess.OnlineTransactionManager.finalize(OnlineTransactionManager.java:399) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
Hi all I have run a stranger issue: I use ADO.NET 2.0 to access sql2000 database. during the whole process, I need stop sql server service which the program is connecting. my setup is like following: 1.Open a conection to access table and then close the connection; 2.restart sql server service ; 3.Re-open a connection to access table and then an exception was thrown out: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed bythe remote host.) 4. try re-open a connection to access table and then no exception was thrown out. I think this maybe related with connection pool. any guy know the detail, please give me a response. Thank you very much!
Hi experts, I have sql express installed on my machine and i'm using visual studio to create database files. After i've build a connection to my database file thru Server Explorer (choose Add attach files) i opened Management Studio Express and found that the new database has been attached to sqlexpress database engine----technically speaking it's under the user instance which i use to run my visual studio. right?? that's totally fine.My question is, after i'v closed the connection in visual studio, that attached database file still exist.I want it to be detached immediately after i've closed the connection in visual studio.How can i do that? I've searched through internet and was told that sp_config can solve this problem by setting the user instance time out. I ran sp_config against my database but did not find that item. Could anybody give me some directions? thanks in advance.
Hi, I'm running a website using MSSQL 2000. Sometimes (not always) I get this error message on the website: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) I have also websites running with MySQL and those don't have this problem.I searched google but I couldn't find usefull information on this problem. Someone who knows what's going on here ?
Today while trying to get the Windows NT security working i upgraded my reporting services IIS server to a domain controller and it screwed up all of my settings. First it changed password for ASPNET user and so I reinstalled .net framework.
Now i get the
The underlying connection was closed: Could not establish secure channel for SSL/TLS.
error message.
I do not want to use an SSL certificate for I do not have one right now. How can I configure my SQL Server 2000 Reporting services to not use SSL. I see they added something to SQL Reporting Services 2005 in the configuration tools but I cant find out how to modify the config files with SQL 2000 RS to eliminate the SSL.
Please help, my company is down waiting for me to get this back up.
I am getting this error in Enterprise Manager: TCP Provider: An existing connection was forcibly closed by the remote host.
But, my web app can still connect just fine to the db, so it's still in the same place with the same login/password. And my registration in EM was working just fine (for years) until yesterday I got this error. I've tried deleting the registration and re-creating it but the same thing. What could have gone wrong to cause this to happen?
Thanks for any pointers, I have no idea where to start looking on this one, the host says they haven't changed anything...
We have a mature instance of SQL Server 2000 reporting services that has stopped working for no apparent reason. When browsing to http://reportserver/reports we receive the following error
Error
The underlying connection was closed: Unable to connect to the remote server.
Home
The installation is running on three servers - 1 sql cluster (sql 2000 sp4) and two IIS servers all running windows 2000 sp4.
The Reportserver website runs using identity impersonation using the .net machine.config file pointing to an encrypted registry key entry holding the userid and password. It has been moved from the default website to it's own website but has been working with no issues for years. No obvious patches have been applied or security changes made that could effect the application
When browsing to http://reportserver/reportserver we can view the loaded reports and even run them with no issues, only ther report manager isn't working.
I have tried changing the impersonation registry key ( using aspnet_setreg ) and the account the reportserver web service runs under ( using the rsconfig utiltity) to be a domain admin to no effect and I have checked and set specififc permission for the reportserver database on all registry keys to no effect.
None of the online solutions for this issue have worked for me. Any help or ideas would be greatly appreciated
We have a nagging issue here in our application side, which I was trying to troubleshoot and reach no where. Can I have your valuable inputs for resolving/understanding the root cause of the issue?
3709-The connection cannot be used to perform this operation. It is either closed or invalid in this context
This error is not coming regularly (twice it happened and after the program is running successfully with out any problem). Problem having exe is running every 2 minutes interval.
Most of the sites saying this is something related to code written in the application but if that is the case why this error is not happening continuously? The problem having exe is running past 4 months with 2 minutes interval and suddenly thrown this error.
I found one MS site describing about this error but not able to find any fixes for this issue (http://support.microsoft.com/kb/839428). We are on the process of upgrading the operating system with SP2; will this help us to resolve this issue? Please advice.
Details
1. Windows 2003 with SP1 2. MDAC 2.8 3. SQL 2005 with SP1 4. VB Application.
I am trying to setup SQL Server 2000 Reporting services with an SSL connection. The SQL Server (Windows Server 2003 SP2 Standard) and Reporting Server (Windows Server 2003 R2 SP2 Standard) are on separate machines. I have tried setting up Certificates from both and Stand-Alone and Enterprise CA. I have tried several combinations of the Issue To name (server | server.company | server.company.local) I have modified the rsWebApplication.config and rsReportServer.config to match the certificate€™s Issue to exactly. I have tried installs with both Domain Accounts and NT AUTHORITYSYSTEM logins. I have managed to get https://server/ReportServer to work but I have had no luck with the report manager https://server/reports. How do I fix this error?
I'm using SQL Server 2005 (SP1) Reporting Services on Windows Server 2003 SP1. I access the report server from Internet using SSL, but the server is not exposed directly to the internet. It is behind a firewall, where the required ssl port is setup and is working fine.
In my Reporting Server, the /ReportServer folder works perfect and I can navigate and view all reports. It is the /Reports folder the one that does not work fine. I can enter the /Reports folder, and can list all the reports. But, when I select one of the reports, and it starts rendering, I get the error message:
"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure."
Then, All the Web Servers will drop all connections and stop the network service. Later, the network service will start up automatically but all the before service is dropped.
We would like to know the error coming from?
Error Log
================
TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host
Event Type: Warning Event Source: ASP.NET 2.0.50727.0 Event Category: Web Event Event ID: 1309 Date: 4/29/2006 Time: 10:48:47 AM User: N/A Computer: 88DBWEB0 Description: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 4/29/2006 10:48:47 AM Event time (UTC): 4/29/2006 2:48:47 AM Event ID: 77910e6688484582bb1c29808feef883 Event sequence: 128 Event occurrence: 13 Event detail code: 0
Process information: Process ID: 1568 Process name: w3wp.exe Account name: NT AUTHORITYNETWORK SERVICE
Exception information: Exception type: SqlException Exception message: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
Request information: Request URL: http://88db.jobsdb.com/ph/Views/MediaUpload.aspx?PostID=50202&Type=I&panelid=postimagediv Request path: /ph/Views/MediaUpload.aspx User host address: 192.168.10.10 User: 50077 Is authenticated: True Authentication Type: Forms Thread account name: NT AUTHORITYNETWORK SERVICE
Thread information: Thread ID: 15 Thread account name: NT AUTHORITYNETWORK SERVICE Is impersonating: False Stack trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParserStateObject.WriteSni() at System.Data.SqlClient.TdsParserStateObject.ExecuteFlush() at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader() at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context, String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actionFlags)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
If you connect to a server and open a query in SQL Managment studio (2005) and looses connection and then regain the connection, when you try to run the query it gives me a "TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host." This happens against both 2005 and 2000 servers. If I re-run the query it works. However, this happens in our VB.NET app as well for clients with Wireless connections. So, something has changed in Framework 2.0 regarding this, does anyone know how to tell the client to not throw this error and just try connecting the server instead which will work?
For a long time I've had SQL Server 2000 with RS on a Server2003 machine. When I want to publish a report from my Dev box, I remove anon. access on the Production machine, deploy the report, then go into report manager to tweak a couple of parameters. I then re-enable anon. access so users can continue.
Yesterday, I removed anon. access and deployed the report but when I went into Report Manager I received the above error message... "The underlying connection was closed: An unexpected error occurred on a receive."
I can get into report manager with anonymous access enabled, but I don't have authority to do anything.
What's happened!!!? More importantly, how do I fix it?
what can cause the above error when connecting to an endpoint via a c# app? the app, and sql are both on my machine ( im just doing this for test purposes and to learn something new.)
First off I understand that it is a horrible idea to run extremely large/long running reports, but sometimes it ends up being the best possible solution due to external forces.
I've got a 25,000 page report that we recently converted from crystal reports to SSRS. The SSRS server is a 64bit 2003 server with 32 gigs of ram running SSRS 2005. When running the report through the report manager web application, it renders in the browser/viewer after about 12 minutes. Exporting to pdf through the browser/viewer in the report manager takes an additional 55 minutes. It does work and it produces a whopping 1.03gb pdf.
Unfortunately, I've run into a problem when trying to do this from a console application using the SSRS client API. After about 30-35 minutes I get an exception on the client with the following error: Exception Message: The underlying connection was closed: An unexpected error occurred on a receive. InnerException = Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Here is the api call:
Code Snippet
byte[] m_data = reportingService.Render(this.ReportPath, this.ExportFormat, null, deviceInfo, selectedParameters, null, null, out encoding, out m_mimeType,
out usedParameters, out warnings, out streamIds); Here are some things I've tried so far:
set the HttpRuntime ExecutionTimeout value to 3 hours on the report server disabled http keep alives on the report server increased the script timeout on the report server set the report to never time out on the server set the report timeout to several hours on the client call Disabled antivirus on the client side, and verified there was no antivirus running on the reporting server. Tried using default credentials in the ReportingService object as opposed to supplying credentailsAny ideas would be appreciated. I understand the best solution is to split the report up into smaller reports, which is the backup option, but being able to keep it as one report is the goal.
Hello,I have a C++ / MFC app which uses CDatabase and CRecordset to connect to aODBC data source for a SQL Server 7 database. The application workedproperly with a MySQL database, but after swapping it for SQL Serverproblems emerged. In particular, any calls to CRecordset::AddNew() andCRecordset::Edit() cause an exception to be thrown with the error message"Recordset is read-only". Stepping through the code for CRecordset::Open(),I can see that it indeeds fail to open the recordset with SQL_CONCUR_ROWVERand SQL_CONCUR_LOCK, finally succeeding with SQL_CONCUR_READ_ONLY. I need tobe able to write to the db!! What is going on here??I call CRecordset::Open() with no SQL string and no options (which defaultsto full access and not read-only).I am not a SQL Server expert, but I tried playing with the config a littlebit:- The database is NOT set for read-only.- The database option "Restrict Access" is NOT selected.- I checkmarked all permissions (SELECT, INSERT, UPDATE, DELETE, DRI)for my app's user on all tables in the db.- My connection string uses the user 'sa', which is the login name forthe user 'dbo'.In the ODBC data source config, I set authentication to SQL Serverauthentication, and accepted the default for all the other options.I haven't tried using a different class (say, CDaoRecordset) nor do I planon doing that. I really need to get this to work with CRecordset. Any helpis appreciated.Thanks,SL
Hey guys i have installed SQL Server Express and getting a problem. Every time I use the runcommand and enter sqlcmd. It opens the window but then I cannot enter any information into it. And after a while the window just closes.
several months ago I briefly set up a data source, tested it and created a very simple report.
I now have an chance to get back into it and when I am at the SSRS Home page and click the button to start "Report Builder I get the yellow bar at the bottom of the page like I'm trying to open a file. It says: "Do you Want to open or save ReportBuilder_3_0_0_0_0.appliation(15.2 KB) from caholoweckyw7" and then the Open, Save and Cancel buttons. If I click open, the actual XML code behind the page appears and the application does not start. ?
The data source has been created and the connection has been tested successfully. I am running SQL Server 2012 and Windows 7 and IE 9.
I am trying to open reports through an existing application. When I click the button to run the report, the new window opens, appears to be trying to load (the windows logo in the top corner is flowing, the hourglass is present), and then stops. I am left with a blank window, no report, and no error message.
I am able to view and run the reports through the Report Server. Other users are able to run the reports through the application.
when i click on the modify option on a stored procedure it is not opening for editing as earlier. it opens as if for scripting.for example i clicked modify procedure on stored proc. "text" and the result is as follows.
/****** Object: StoredProcedure [dbo].[test] Script Date: 05/01/2015 7:50:08 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[test]') AND type in (N'P', N'PC'))
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database) Help pleaseee
I have an sp, which has 2 select statements, so iam using a sqldatareader and binding the data to a dropdown. the first binding is fine, but when i say dataReader.NextResult(), It is null.It says the reader is closed. Can any one tell a work around for this.
without con.close(),it can return Resultset ,but when includeing con.close(),an Exception tell me:Object has been closed, in other programms i've close connection,but it never throws this Exception,why? thanks