By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,467 Members | 1,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,467 IT Pros & Developers. It's quick & easy.

Internal connection fatal error

P: n/a
We are running a asp.net site, we are using a tiered architecture with the data class looking like

Function MyDataReader(ByVal stylemainid As Int32, ByVal letter As String) As SqlDataReade
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("c onnectionString")
myConnection.Open(
Dim myCommand As SqlCommand = New SqlCommand("", myConnection
myCommand.CommandType = CommandType.StoredProcedur
Dim styleparam As SqlParameter = New SqlParameter("@stylemainid", SqlDbType.Int
styleparam.Value = stylemaini
myCommand.Parameters.Add(styleparam
Dim styleparam2 As SqlParameter = New SqlParameter("@letter", SqlDbType.Char
styleparam2.Value = lette
myCommand.Parameters.Add(styleparam2
Return myCommand.ExecuteReader(CommandBehavior.CloseConne ction
End Functio

The problem we have it intermitten errors from the try, catch block and they report:

System.InvalidOperationException: Internal connection fatal error
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior
at vs2.MyDataReader.RunASQLStatement_ReturnReader(Str ing sql
at vs2.icart.AddTuneToCart(
at vs2.icart.Page_Load(Object sender, EventArgs e

We have tried everything, even rewritten the data access, basically we have a test page the refreshes every 30 seconds and re-reads a table and sure enough it will just work then suddenly display the above errors. please help.
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You're probably doing this already, but I wanted to check whether you are
closing your datareader appropriately after using it.

CommandBehavior.CloseConnection closes the Connection object when the
associated DataReader object is closed. Is it possible that you are running
out of connections? Can you monitor the connection count?

"m.Ward" <ma**@vinylsearcher.com> wrote in message
news:C0**********************************@microsof t.com...
We are running a asp.net site, we are using a tiered architecture with the
data class looking like:

Function MyDataReader(ByVal stylemainid As Int32, ByVal letter As
String) As SqlDataReader
Dim myConnection As SqlConnection = New
SqlConnection(ConfigurationSettings.AppSettings("c onnectionString"))
myConnection.Open()
Dim myCommand As SqlCommand = New SqlCommand("", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim styleparam As SqlParameter = New SqlParameter("@stylemainid",
SqlDbType.Int)
styleparam.Value = stylemainid
myCommand.Parameters.Add(styleparam)
Dim styleparam2 As SqlParameter = New SqlParameter("@letter",
SqlDbType.Char)
styleparam2.Value = letter
myCommand.Parameters.Add(styleparam2)
Return myCommand.ExecuteReader(CommandBehavior.CloseConne ction)
End Function

The problem we have it intermitten errors from the try, catch block and
they report:

System.InvalidOperationException: Internal connection fatal error.
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior
behavior)
at vs2.MyDataReader.RunASQLStatement_ReturnReader(Str ing sql)
at vs2.icart.AddTuneToCart()
at vs2.icart.Page_Load(Object sender, EventArgs e)

We have tried everything, even rewritten the data access, basically we
have a test page the refreshes every 30 seconds and re-reads a table and
sure enough it will just work then suddenly display the above errors.
please help.


Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.