Click here to Skip to main content
15,922,533 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralJump to another ASPX page and run its class function of that ASPX page. Pin
VinothRao10-Jan-08 17:19
VinothRao10-Jan-08 17:19 
GeneralRe: Jump to another ASPX page and run its class function of that ASPX page. Pin
Parwej Ahamad10-Jan-08 18:02
professionalParwej Ahamad10-Jan-08 18:02 
GeneralRe: Jump to another ASPX page and run its class function of that ASPX page. Pin
N a v a n e e t h10-Jan-08 18:07
N a v a n e e t h10-Jan-08 18:07 
GeneralInsert images in to MySql database Pin
yadlaprasad10-Jan-08 9:13
yadlaprasad10-Jan-08 9:13 
GeneralRe: Insert images in to MySql database Pin
Pete O'Hanlon10-Jan-08 11:01
mvePete O'Hanlon10-Jan-08 11:01 
GeneralSomething broke (DataBind Gone Wild) Pin
Todd Smith10-Jan-08 8:18
Todd Smith10-Jan-08 8:18 
GeneralRe: Fixed Pin
Todd Smith10-Jan-08 9:33
Todd Smith10-Jan-08 9:33 
QuestionEnterprise library throws exception once a day: Invalid operation. The connection is closed Pin
HappyASPNETCoding10-Jan-08 7:46
HappyASPNETCoding10-Jan-08 7:46 
I got this exception once a day on my website, and subsequent visit to the web site is fine. I debugged through my code and the connection state is always 'Closed' on any connection even when there is no problem. I guess Enterprise library is handling connection automatically, but why do I get this exception once a day? I am using .NET2.0, Sql2000 and Enterprise library (2.0)


Here's the code:
public static DataTable GetDataTable(string procName) {
DataSet dataSet = new DataSet();

try {
Database database = DatabaseFactory.CreateDatabase("myProject");
//use GetSqlStringCommand so that it accepts sp with parameter
command = database.GetSqlStringCommand(procName);
dataSet = database.ExecuteDataSet(command);
}
catch(Exception exception) {
Utilities.ProcessException(exception, procName);
}

return dataSet.Tables[0];
}

And here's the exception:
Message:Invalid operation. The connection is closed.
Source:System.Data
Method:System.Data.SqlClient.SqlInternalConnection GetOpenConnection()
Stack Trace: at System.Data.SqlClient.SqlConnection.GetOpenConnection()
at System.Data.SqlClient.SqlConnection.get_Parser()
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoLoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String tableName)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet(DbCommand command)
at DataAccess.GetDataTable(String procName) in d:\Inetpub\www\wwwroot\data\App_Code\DataAccess.cs:line 81
GeneralRe: Enterprise library throws exception once a day: Invalid operation. The connection is closed Pin
Pete O'Hanlon10-Jan-08 10:32
mvePete O'Hanlon10-Jan-08 10:32 
GeneralRe: Enterprise library throws exception once a day: Invalid operation. The connection is closed Pin
HappyASPNETCoding11-Jan-08 9:35
HappyASPNETCoding11-Jan-08 9:35 
GeneralMy ASP.NET DataGrid is not showing up in web page [modified] Pin
dyerstein10-Jan-08 7:02
dyerstein10-Jan-08 7:02 
QuestionUsing Outlook tasks and calendar in my ASP net web application Pin
Member 475670910-Jan-08 5:46
Member 475670910-Jan-08 5:46 
Generalcss styles Pin
solarthur0110-Jan-08 4:32
solarthur0110-Jan-08 4:32 
Generalgridview problem Pin
solarthur0110-Jan-08 3:02
solarthur0110-Jan-08 3:02 
GeneralRe: gridview problem Pin
Declan Bright10-Jan-08 3:06
Declan Bright10-Jan-08 3:06 
GeneralRe: gridview problem Pin
solarthur0110-Jan-08 3:19
solarthur0110-Jan-08 3:19 
GeneralCreate Image from html string Pin
Imran Khan Pathan10-Jan-08 1:29
Imran Khan Pathan10-Jan-08 1:29 
GeneralRe: Create Image from html string Pin
N a v a n e e t h10-Jan-08 1:35
N a v a n e e t h10-Jan-08 1:35 
GeneralRe: Create Image from html string Pin
Imran Khan Pathan10-Jan-08 1:56
Imran Khan Pathan10-Jan-08 1:56 
GeneralRe: Create Image from html string Pin
N a v a n e e t h10-Jan-08 2:06
N a v a n e e t h10-Jan-08 2:06 
GeneralRe: Create Image from html string Pin
Imran Khan Pathan10-Jan-08 2:18
Imran Khan Pathan10-Jan-08 2:18 
GeneralDisplay Msgbox Pin
Rinki Mukheraji10-Jan-08 0:47
Rinki Mukheraji10-Jan-08 0:47 
GeneralRe: Display Msgbox Pin
Declan Bright10-Jan-08 1:13
Declan Bright10-Jan-08 1:13 
GeneralRe: Display Msgbox Pin
Rinki Mukheraji10-Jan-08 1:23
Rinki Mukheraji10-Jan-08 1:23 
GeneralRe: Display Msgbox Pin
Declan Bright10-Jan-08 2:53
Declan Bright10-Jan-08 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.