Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Friday, March 30, 2012

Internal Connection Fatal Error - SQL 2000 and ASP VS 2003

We have an ASP.NET 2003 app that accesses a MS SQL 2000 Std. database. Rand
omly it returns this error:
Internal connection fatal error.
Description: An unhandled exception occurred during the execution of the cur
rent web request. Please review the stack trace for more information about t
he error and where it originated in the code.
Exception Details: System.InvalidOperationException: Internal connection fat
al error.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Internal connection fatal error.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +195
tradeTicket.MonetaGroup.Approval.approve(Int32 Trans_ID, String Security_Typ
e) in C:\Inetpub\wwwroot\tradeTicket\Data\empl
oyee.vb:1191
tradeTicket.ApproveBond.buttonApproveNew_Click(Object sender, EventArgs e) i
n C:\Inetpub\wwwroot\tradeTicket\ApproveBo
nd.aspx.vb:469
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page. RaisePostBackEvent(IPostBackEventHandler
sourceControl, S
tring eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
----
--
Version Information: Microsoft NET Framework Version:1.1.4322.573; ASP.NET V
ersion:1.1.4322.573
We have SQL Server 2000 and Win2000 Server.
Microsoft SQL Server 2000 - 8.00.534 (Intel X86) Nov 19 2001 13:23:50 Cop
yright (c) 1988-2000 Microsoft Corporation Standard Edition on Windows NT 5
.0 (Build 2195: Service Pack 3)
Is there a setting I can bump up to fix this problem? We do close our conne
ctions. Here is a snippet of code:
----
--
Private Sub buttonApproveNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles buttonApproveNew.Click
Dim Approve As New MonetaGroup.Approval()
Dim curId = Request.QueryString("id")
Dim curSecurity = "B"
Dim nextID As String
Dim nextSecurity As String
Dim nextTransStatus As Integer
Approve.FindNextUnapprovedTransaction(curId, curSecurity, nextID, nextSecuri
ty, nextTransStatus)
Approve.approve(Request.QueryString("id"), "B") 'Line 469 error message
If nextID <> 0 Then
Dim returnValue = checkSecurity(nextID, nextTransStatus, nextSecurity)
Dim strBuilder As StringBuilder = New StringBuilder()
strBuilder.Append("<script language='javascript'>")
'strBuilder.Append("alert('The transaction was approved.');")
strBuilder.Append("window.open('" & returnValue & "','_self');")
strBuilder.Append("</script>")
RegisterStartupScript("focus", strBuilder.ToString)
Else
Dim strBuilder As StringBuilder = New StringBuilder()
strBuilder.Append("<script language='javascript'>")
'strBuilder.Append("alert('The transaction was approved.');")
strBuilder.Append("window.open('Approval.aspx','_self');")
strBuilder.Append("</script>")
RegisterStartupScript("focus", strBuilder.ToString)
End If
End Sub
Public Function checkSecurity(ByVal id As Integer, ByVal status As Integer,
ByVal security As String)
Dim returnValue As String
If status = 2 Then
If security = "MF" Then
returnValue = "../tradeTicket/ApproveMF.aspx?id=" & id & "&approve=0"
ElseIf security = "S" Then
returnValue = "../tradeTicket/ApproveStock.aspx?id=" & id & "&approve=0"
ElseIf security = "B" Then
returnValue = "../tradeTicket/ApproveBond.aspx?id=" & id & "&approve=0"
End If
Else
If security = "MF" Then
returnValue = "../tradeTicket/ApproveMF.aspx?id=" & id & "&approve=1"
ElseIf security = "S" Then
returnValue = "../tradeTicket/ApproveStock.aspx?id=" & id & "&approve=1"
ElseIf security = "B" Then
returnValue = "../tradeTicket/ApproveBond.aspx?id=" & id & "&approve=1"
End If
End If
Return returnValue
End Function
----
--
Thank you in advance.
RichWe're having the same issue. Our setup is Win 2003 Server IIS and Win 2000
SQL. I've found that the version of MDAC is different on the two machines.
Is your setup also 2 machines? If it is, let me know if your versions of M
DAC differ.
Thanks,
Bobsql

Internal Connection Fatal Error - SQL 2000 and ASP VS 2003

We have an ASP.NET 2003 app that accesses a MS SQL 2000 Std. database. Randomly it returns this error:
Internal connection fatal error.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Internal connection fatal error.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Internal connection fatal error.]
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +195
tradeTicket.MonetaGroup.Approval.approve(Int32 Trans_ID, String Security_Type) in C:\Inetpub\wwwroot\tradeTicket\Data\employee.vb:11 91
tradeTicket.ApproveBond.buttonApproveNew_Click(Obj ect sender, EventArgs e) in C:\Inetpub\wwwroot\tradeTicket\ApproveBond.aspx.vb :469
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
Version Information: Microsoft NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
We have SQL Server 2000 and Win2000 Server.
Microsoft SQL Server 2000 - 8.00.534 (Intel X86) Nov 19 2001 13:23:50 Copyright (c) 1988-2000 Microsoft Corporation Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 3)
Is there a setting I can bump up to fix this problem? We do close our connections. Here is a snippet of code:
Private Sub buttonApproveNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonApproveNew.Click
Dim Approve As New MonetaGroup.Approval()
Dim curId = Request.QueryString("id")
Dim curSecurity = "B"
Dim nextID As String
Dim nextSecurity As String
Dim nextTransStatus As Integer
Approve.FindNextUnapprovedTransaction(curId, curSecurity, nextID, nextSecurity, nextTransStatus)
Approve.approve(Request.QueryString("id"), "B") 'Line 469 error message
If nextID <> 0 Then
Dim returnValue = checkSecurity(nextID, nextTransStatus, nextSecurity)
Dim strBuilder As StringBuilder = New StringBuilder()
strBuilder.Append("<script language='javascript'>")
'strBuilder.Append("alert('The transaction was approved.');")
strBuilder.Append("window.open('" & returnValue & "','_self');")
strBuilder.Append("</script>")
RegisterStartupScript("focus", strBuilder.ToString)
Else
Dim strBuilder As StringBuilder = New StringBuilder()
strBuilder.Append("<script language='javascript'>")
'strBuilder.Append("alert('The transaction was approved.');")
strBuilder.Append("window.open('Approval.aspx','_s elf');")
strBuilder.Append("</script>")
RegisterStartupScript("focus", strBuilder.ToString)
End If
End Sub
Public Function checkSecurity(ByVal id As Integer, ByVal status As Integer, ByVal security As String)
Dim returnValue As String
If status = 2 Then
If security = "MF" Then
returnValue = "../tradeTicket/ApproveMF.aspx?id=" & id & "&approve=0"
ElseIf security = "S" Then
returnValue = "../tradeTicket/ApproveStock.aspx?id=" & id & "&approve=0"
ElseIf security = "B" Then
returnValue = "../tradeTicket/ApproveBond.aspx?id=" & id & "&approve=0"
End If
Else
If security = "MF" Then
returnValue = "../tradeTicket/ApproveMF.aspx?id=" & id & "&approve=1"
ElseIf security = "S" Then
returnValue = "../tradeTicket/ApproveStock.aspx?id=" & id & "&approve=1"
ElseIf security = "B" Then
returnValue = "../tradeTicket/ApproveBond.aspx?id=" & id & "&approve=1"
End If
End If
Return returnValue
End Function
Thank you in advance.
Rich
We're having the same issue. Our setup is Win 2003 Server IIS and Win 2000 SQL. I've found that the version of MDAC is different on the two machines. Is your setup also 2 machines? If it is, let me know if your versions of MDAC differ.
Thanks,
Bob

Intermittent SQL Server does not exist or access denied.

ASP.NET application with intermittent returns of 503 errors with the
following message.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied. SQL Server does not exist or access denied.
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Servers running Windows 2003 SQL 2000.
This has been a problem for a long time (less than .3% of the time). No
code changes have been made. The only changes was Windows SP1 and post
SP patches on all servers. The patching may have made this issue more
pronounced.
Any suggestions from the experts?
Thanks,
RoxanneWhen they are intermittent they are difficult to track down.
Often those related to network connectivity issues. Have you
checked the event logs on the IIS box - particularly looking
for any network related issues?
-Sue
On 2 Nov 2005 10:32:52 -0800, roxy636@.yahoo.com wrote:

>ASP.NET application with intermittent returns of 503 errors with the
>following message.
>System.Data.SqlClient.SqlException: SQL Server does not exist or access
>denied. SQL Server does not exist or access denied.
>An unhandled exception was generated during the execution of the
>current web request. Information regarding the origin and location of
>the exception can be identified using the exception stack trace below.
>Servers running Windows 2003 SQL 2000.
>This has been a problem for a long time (less than .3% of the time). No
>code changes have been made. The only changes was Windows SP1 and post
>SP patches on all servers. The patching may have made this issue more
>pronounced.
>Any suggestions from the experts?
>Thanks,
>Roxanne|||Search no further...
http://support.microsoft.com/defaul...kb;en-us;328476
Note, this answer took forever to find so I'm posting everywhere...|||So was your solution to enable connection pooling? Or was it simply a
tcp/ip configuration issue. Unless you explicitly disable connection
pooling, then connections should be pooled, were you disabling pooling?
Thanks for any info, we are seeing the exact same symptoms at a client
of ours.|||Connection pooling was disabled for security reasons, so you need to
add registry keys specified in article here:
path:
HKEY_LOCAL_MACHINE\System\CurrentControl
Set\services\Tcpip\Parameters
type: DWORD
name: TcpTimedWaitDelay
value: 30 (decimal)
type: DWORD
name: MaxUserPort
value: 10000 (decimal)
Ultimately is connection ooliing is enabled this shouldn't happen, but
try it anyway. Check netsats from command prompt...if you see around
4000 connections in TIME_WAIT, then that is the problem.|||Thanks, since connection pooling is enabled and this is occuring even
soon after a reboot under low load. I do not suspect we are creating
too many connections to sql, but I do suspect some network
communication problems. I am going to further diagnose thier network
configuration relative to the front and back planes of the web server.
But I will not overlook this as a possibility, so I will also get a
netstat -n Thanks so much for the info..|||Turned out to be Bandwidth Throttling, disabling that option for the
Application Pool alleviated the HTTP 503 errors.

Intermittent SQL Server does not exist or access denied.

ASP.NET application with intermittent returns of 503 errors with the
following message.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied. SQL Server does not exist or access denied.
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Servers running Windows 2003 SQL 2000.
This has been a problem for a long time (less than .3% of the time). No
code changes have been made. The only changes was Windows SP1 and post
SP patches on all servers. The patching may have made this issue more
pronounced.
Any suggestions from the experts?
Thanks,
Roxanne
When they are intermittent they are difficult to track down.
Often those related to network connectivity issues. Have you
checked the event logs on the IIS box - particularly looking
for any network related issues?
-Sue
On 2 Nov 2005 10:32:52 -0800, roxy636@.yahoo.com wrote:

>ASP.NET application with intermittent returns of 503 errors with the
>following message.
>System.Data.SqlClient.SqlException: SQL Server does not exist or access
>denied. SQL Server does not exist or access denied.
>An unhandled exception was generated during the execution of the
>current web request. Information regarding the origin and location of
>the exception can be identified using the exception stack trace below.
>Servers running Windows 2003 SQL 2000.
>This has been a problem for a long time (less than .3% of the time). No
>code changes have been made. The only changes was Windows SP1 and post
>SP patches on all servers. The patching may have made this issue more
>pronounced.
>Any suggestions from the experts?
>Thanks,
>Roxanne
|||Search no further...
http://support.microsoft.com/default...b;en-us;328476
Note, this answer took forever to find so I'm posting everywhere...
|||So was your solution to enable connection pooling? Or was it simply a
tcp/ip configuration issue. Unless you explicitly disable connection
pooling, then connections should be pooled, were you disabling pooling?
Thanks for any info, we are seeing the exact same symptoms at a client
of ours.
|||Connection pooling was disabled for security reasons, so you need to
add registry keys specified in article here:
path:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\servic es\Tcpip\Parameters
type: DWORD
name: TcpTimedWaitDelay
value: 30 (decimal)
type: DWORD
name: MaxUserPort
value: 10000 (decimal)
Ultimately is connection ooliing is enabled this shouldn't happen, but
try it anyway. Check netsats from command prompt...if you see around
4000 connections in TIME_WAIT, then that is the problem.
|||Thanks, since connection pooling is enabled and this is occuring even
soon after a reboot under low load. I do not suspect we are creating
too many connections to sql, but I do suspect some network
communication problems. I am going to further diagnose thier network
configuration relative to the front and back planes of the web server.
But I will not overlook this as a possibility, so I will also get a
netstat -n Thanks so much for the info..
|||Turned out to be Bandwidth Throttling, disabling that option for the
Application Pool alleviated the HTTP 503 errors.

Monday, March 19, 2012

Intercept Result

Hi,

I am trying to write a system (Stored Proc, View, CLR Proc, ?), where if you query a specific table and it returns data from only 1 column for the submitted SELECT statement then substitute data obtained from an external web service.

Does anyone have any suggestions about how best to implement this? I have searched through the BOL but nothing directly deals with what I want to do.

Thanks,

Blair

P.S. I am using SQL SERVER 2005 ENT Edition with everything available.

Hi,

I'm not very clear with your question.

For substituting a result, you can use CASE within your SELECT statement.

Assuming Table1 table with Col1 as column, and a scalar valued function CLRFunction() which will call a web service,

SELECT CASE Col1
WHEN 'abc' THEN CLRFunction(1)
WHEN 'def' THEN CLRFunction(2)
END 'Col1'
FROM Table1

Here 'abc' and 'def' are the values stored in Col1 of Table1

Hope this answers for your query, else please explain your requirement with some more detail.

Regards

Babu

|||

Thanks that is exactly what I was looking for. I now know what to do.

blair

|||

Hello...

I think calling a webservie inside a SP is not a very good behavior. You should write your SPs so that they finish as fast as possible. If you try to access an outside resource you never know how long it will take(and a webservice is even worse). You should consider moving this logic into your application. Also you need to access external resources in that function, so you have to declare it as "unsafe" which will also have some implications on security...

Also it will be more complicated to make your app responsive while your code is waiting on the SQL Server. Calling a webservice async is very easy... Calling SQL is a little more work (but still no big deal)