C
Carl Howarth
Hello again everyone..... I'm a real pain and keep posting re the same
thing, but it is possibly the most frustrating issue I've come across.
Please see my original post - can anybody think of a solution to this? The
main error I experience is an sqlexception saying 'General Network Error',
but as this is sporadic, and due to the fact that asp3 apps work fine I am
at a total loss as to what the issue can be.
In addition to this I connect to the database using the following:
The connections in the current activity (SQL) show as 'sleeping', which
suggests
to me that the connections have been closed.
I am using a component to access the database, based on the following:
Public ReadOnly Property ConnectionString()
Get
ConnectionString = "Data Source=10.200.20.2; Initial Catalog=ClientCAS;User
ID=sa;Password=password; Network Library=dbmssocn;"
End Get
End Property
Public Function GetReader(ByVal strSQL As String) As SqlDataReader
Dim tmpConn As New SqlConnection(Me.ConnectionString)
Dim objCmd As New SqlCommand(strSQL, tmpConn)
objCmd.Connection.Open()
objCmd.CommandTimeout = 300
GetReader = objCmd.ExecuteReader(CommandBehavior.CloseConnection)
objCmd = Nothing
End Function
And then within my pages' back end code I would do something along these
lines to fill, say, a datagrid:
dim obj as new cpData
dim dr as sqldatareader = obj.GetReader("spStoredProc " & id)
dg.datasource = dr
dg.databind
dr.close
dr = nothing
obj = nothing
---------------------->
Hi Gregory,
Thanks for coming back to me. I am at a loss with this but will run some
checks as you have suggested. The network issue really is confusing,
certainly since the 'classic' asp applications that we are running do not
experience this problem at all.
Whilst testing, I have noticed that if I log into the system and jump
between pages at frequent intervals it seems to work perfectly. It seems
that if I leave a page displayed for any length of time then choose another
lin k that is when the system freezes up - I don't know if that gives you
any further clues. I have altered the web.config file to say debug="false",
which has made no difference and have checked the code and I certainly
believe that all objects used are being destroyed after use.
Another clue that may help is that part of the system is 'upgraded' classic
asp, ie we have simply converted the existing asp pages and got rid of the
'set' commands, used isdbnull instead of isnull, and have set aspcompat
accordingly (only on converted pages), I cannot see this as being an issue
due to the fact that these all work wonderfully on my machine.
If you have any other ideas (or not!) in relation to this please let me
know.
Many thanks again, Carl
thing, but it is possibly the most frustrating issue I've come across.
Please see my original post - can anybody think of a solution to this? The
main error I experience is an sqlexception saying 'General Network Error',
but as this is sporadic, and due to the fact that asp3 apps work fine I am
at a total loss as to what the issue can be.
In addition to this I connect to the database using the following:
The connections in the current activity (SQL) show as 'sleeping', which
suggests
to me that the connections have been closed.
I am using a component to access the database, based on the following:
Public ReadOnly Property ConnectionString()
Get
ConnectionString = "Data Source=10.200.20.2; Initial Catalog=ClientCAS;User
ID=sa;Password=password; Network Library=dbmssocn;"
End Get
End Property
Public Function GetReader(ByVal strSQL As String) As SqlDataReader
Dim tmpConn As New SqlConnection(Me.ConnectionString)
Dim objCmd As New SqlCommand(strSQL, tmpConn)
objCmd.Connection.Open()
objCmd.CommandTimeout = 300
GetReader = objCmd.ExecuteReader(CommandBehavior.CloseConnection)
objCmd = Nothing
End Function
And then within my pages' back end code I would do something along these
lines to fill, say, a datagrid:
dim obj as new cpData
dim dr as sqldatareader = obj.GetReader("spStoredProc " & id)
dg.datasource = dr
dg.databind
dr.close
dr = nothing
obj = nothing
---------------------->
Hi Gregory,
Thanks for coming back to me. I am at a loss with this but will run some
checks as you have suggested. The network issue really is confusing,
certainly since the 'classic' asp applications that we are running do not
experience this problem at all.
Whilst testing, I have noticed that if I log into the system and jump
between pages at frequent intervals it seems to work perfectly. It seems
that if I leave a page displayed for any length of time then choose another
lin k that is when the system freezes up - I don't know if that gives you
any further clues. I have altered the web.config file to say debug="false",
which has made no difference and have checked the code and I certainly
believe that all objects used are being destroyed after use.
Another clue that may help is that part of the system is 'upgraded' classic
asp, ie we have simply converted the existing asp pages and got rid of the
'set' commands, used isdbnull instead of isnull, and have set aspcompat
accordingly (only on converted pages), I cannot see this as being an issue
due to the fact that these all work wonderfully on my machine.
If you have any other ideas (or not!) in relation to this please let me
know.
Many thanks again, Carl