Re: Very strange SQL connection problem
From: Miha Markic [MVP C#] (miha)
Date: 11/24/04
- Next message: suresh kannan: "RE: Dataset"
- Previous message: Deepak: "Re: Database application in C# help"
- In reply to: Stefan Kals: "Re: Very strange SQL connection problem"
- Next in thread: Stefan Kals: "Re: Very strange SQL connection problem"
- Reply: Stefan Kals: "Re: Very strange SQL connection problem"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Nov 2004 12:58:39 +0100
Stefan,
Try creating a *new instance* of SqlConnection and then open and after the
operation Dispose it.
You are only doing Open/Close AFAIK.
-- Miha Markic [MVP C#] - RightHand .NET consulting & development SLODUG - Slovene Developer Users Group www.rthand.com "Stefan Kals" <stefan.kals@css-web.net> wrote in message news:41a46e77$1@e-post.inode.at... >> Let us know. > > Ok, it didn't help.. :( > Strange though that it seems always to "crash" after the application went > to > sleep which i see through the cleared trace file (trace.axd). > > Let me shortly describe the important codelines getting executed, perhaps > you could see something.. > > --- Default.aspx.cs --- > DataHandler handler = new DataHandler(); > > --- DataHandler.cs --- > SqlConnection con = new SqlConnection(); > con.ConnectionString = .... > DataAdapter ad = new ... > ad.Connection = ... > > --- Default.aspx.cs --- > handler.OpenConnection(); > > --- DataHandler.cs --- > con.Open(); > > --- Default.aspx.cs --- > handler.GetSomeData(); > > --- DataHandler.cs --- > ad.Fill(someDataset); > > --- Default.aspx.cs --- > handler.CloseConnection(); > > --- DataHandler.cs --- > con.Close(); > > That's a little bit simplifyed but i can't see a problem with it.. > For testing purposes i know activated connection pooling by setting the > connection string (in web.config) again and got the second exception after > the 30 minutes: > > [FileLoadException: ?] > System.EnterpriseServices.Platform.Initialize() +0 > System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb) > +11 > System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797 > System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl > ctrl) +170 > > System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec > tionString options, Boolean& isInTransaction) +358 > System.Data.SqlClient.SqlConnection.Open() +384 > System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, > ConnectionState& originalState) +44 > System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 > startRecord, Int32 maxRecords, String srcTable, IDbCommand command, > CommandBehavior behavior) +304 > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 > startRecord, > Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior > behavior) +77 > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38 > Kumpfmueller.Data.DataHandler.LoadCategoryDetails(DataSetCategory ds) in > C:\Inetpub\wwwroot\Kumpfmueller\Data\DataHandler.cs:694 > Kumpfmueller.Default.Page_Load(Object sender, EventArgs e) in > C:\Inetpub\wwwroot\Kumpfmueller\Default.aspx.cs:81 > System.Web.UI.Control.OnLoad(EventArgs e) +67 > System.Web.UI.Control.LoadRecursive() +35 > System.Web.UI.Page.ProcessRequestMain() +753 > > > My stomach says it must have to do with some SQL server settings or some > strange SQL connection getting invalid thing or so... > Why should it else be no problem at my dev machine (also during sessions > which require the application to start up)? > > Stefan > >
- Next message: suresh kannan: "RE: Dataset"
- Previous message: Deepak: "Re: Database application in C# help"
- In reply to: Stefan Kals: "Re: Very strange SQL connection problem"
- Next in thread: Stefan Kals: "Re: Very strange SQL connection problem"
- Reply: Stefan Kals: "Re: Very strange SQL connection problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading