Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Saturday, March 31, 2012

There are too many people accessing the Web site at this time.

What resource have I exhausted if a remote client gets the following message?

"The page cannot be displayed
There are too many people accessing the Web site at this time. "You've exhausted IIS. If you're running Windows XP or Windows 2000 Professional, your IIS process can only handle 10 concurrent connections (at the same time). This is by design and you cannot change this, although with XP you can disable HTTP keep-alives in the properties of the
Web site. When you do this, a limit of 10 concurrent connections still exists, but IIS does not maintain connections for inactive users.

If more than ten connections are needed, you will need to upgrade to one of Microsoft's server platforms.

There Is No Source Code Available For The Current Location

Hey,
I have a ASP.NET web application,
And whenever I try to debug a JScript/VBScript block (using- "stop", or
- "debugger;") I get the following error:
"There Is No Source Code Available For The Current Location"
And when I do succeeded debugging the script, I get the same error when
trying to debug a function from an included JS file.
I tried:
restarting the computer
shutting down the computer
restarting the .Net IDE
Clearing the- Temp ASPNET files from the - Microsoft.Net folder (on -
%windir%)
Clearing the IE Temp files
And got no success...
Thanks ahead,

--RamRam wrote:
> Hey,
> I have a ASP.NET web application,
> And whenever I try to debug a JScript/VBScript block (using- "stop",
or
> - "debugger;") I get the following error:
> "There Is No Source Code Available For The Current Location"
> And when I do succeeded debugging the script, I get the same error
when
> trying to debug a function from an included JS file.
> I tried:
> restarting the computer
> shutting down the computer
> restarting the .Net IDE
> Clearing the- Temp ASPNET files from the - Microsoft.Net folder (on -
> %windir%)
> Clearing the IE Temp files
> And got no success...
> Thanks ahead,
> --Ram

Shutdown Visual Studio .NET
Run IISRESET in command window.
Shutdown <YOUR APPLICATION> COM+ applications
Delete <YOUR APPLICATION> temp files found here:
C:\Documents and Settings\<YOUR USER NAME>\VSWebCache
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET Files

It worked for me.

T.H.

There Is No Source Code Available For The Current Location

Hey,
I have a ASP.NET web application,
And whenever I try to debug a JScript/VBScript block (using- "stop", or
- "debugger;") I get the following error:
"There Is No Source Code Available For The Current Location"
And when I do succeeded debugging the script, I get the same error when
trying to debug a function from an included JS file.
I tried:
restarting the computer
shutting down the computer
restarting the .Net IDE
Clearing the- Temp ASPNET files from the - Microsoft.Net folder (on -
%windir%)
Clearing the IE Temp files
And got no success...
Thanks ahead,
--RamRam wrote:
> Hey,
> I have a ASP.NET web application,
> And whenever I try to debug a JScript/VBScript block (using- "stop",
or
> - "debugger;") I get the following error:
> "There Is No Source Code Available For The Current Location"
> And when I do succeeded debugging the script, I get the same error
when
> trying to debug a function from an included JS file.
> I tried:
> restarting the computer
> shutting down the computer
> restarting the .Net IDE
> Clearing the- Temp ASPNET files from the - Microsoft.Net folder (on -
> %windir%)
> Clearing the IE Temp files
> And got no success...
> Thanks ahead,
> --Ram
Shutdown Visual Studio .NET
Run IISRESET in command window.
Shutdown <YOUR APPLICATION> COM+ applications
Delete <YOUR APPLICATION> temp files found here:
C:\Documents and Settings\<YOUR USER NAME>\VSWebCache
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files
It worked for me.
T.H.

There is no source code available for the current location.

I'm debugging my VB.net webapplication, with VS.2005

When I step into the code, I get the following error on this line of code:

ddlServers.DataBind()

"There is no source code available for the current location."

I asks me if I want to show the disassembly.

What goes wrong?

Hi.

where is the code for binding the values to the dropdown..

are u using sqldatasource or coding manually..


I use an ObjectDataSource:

<asp:DropDownList

ID="ddlServers"

runat="server"

style="margin: 10px;"

DataSourceID="ObjectDataSource1"

DataTextField="SERVER_NAME"

DataValueField="SERVER_AND_PORT"

AutoPostBack="True"

meta:resourcekey="ddlServersResource1">

</asp:DropDownList>

<asp:ObjectDataSource

ID="ObjectDataSource1"

runat="server"

SelectMethod="GetServers"

TypeName="Plugin_Manager_BLL.PluginManager"

OldValuesParameterFormatString="original_{0}">

</asp:ObjectDataSource>


as far as I'm aware - you wouldn't need to call the databind() if your ddl has a datasource - this should be done automatically. If you need to re-bind, after a postback for example, why not try to add:

if not page.ispostback then

'do stuff

else

ddl.databind()

end if

maybe try that?


Hi,

Based on my understanding, when you try to step into the code above, you get the error message above. You used ObjectDataSource to bind the control. If I have misunderstood you, please feel free to let me know.

The error message above indicates that the debugger cannot display source code for the current location where execution has stopped. As far as I know, when we use a library without its source code, we cannot show the source code (DataBind method).

To better understand your issue, could you please confirm the following information:

If we create another simple project and bind the DropDownList with ObjectDataSource, does it have the same issue?

Monday, March 26, 2012

This is an ASP.NET complite program and it works fine. An error is genereded if

Hi,

Following is an ASP.NET complite program and it works fine. An error is genereded if there is one record at the last page of the DataGrid.
Here is the error generated by the system System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount.
is there any way to fix this problem?

Here's the Code:
<%@dotnet.itags.org. Import Namespace="System.Data" %>
<%@dotnet.itags.org. Import Namespace="System.Data.SQLClient" %>
<html>
<head>
<meta name="GENERATOR" Content="ASP Express 2.1">
<title>Deleting from DataBase using a DataGrid</title>
<script language="VB" runat="server">

Sub MyDataGrid_DeleteCommand(s As Object, e As DataGridCommandEventArgs )
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim DeleteCmd As String = "DELETE from safetable Where id = @dotnet.itags.org.Id"
Dim MyConn as New SQLConnection(strConn)
Dim Cmd as New SqlCommand(DeleteCmd, MyConn)
Cmd.Parameters.Add(New SqlParameter("@dotnet.itags.org.ID", MyDataGrid.DataKeys(CInt(e.Item.ItemIndex))))
MyConn.Open()
Cmd.ExecuteNonQuery()
MyConn.Close()
BindData
End Sub

Sub Page_Change(sender As Object, e As DataGridPageChangedEventArgs)
MyDataGrid.CurrentPageIndex = e.NewPageIndex
BindData
End Sub

Sub Page_Load(Source As Object, E As EventArgs)
If Not Page.IsPostBack Then
BindData()
End If
End Sub

Sub BindData()
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim MySQL as string = "Select * from safetable Order by id desc"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)
Cmd.Fill(ds,"safetable")
MyDataGrid.Datasource=ds.Tables("safetable").DefaultView
MyDataGrid.DataBind()
End Sub
</script>
</head>
<body>
<form runat="server" method="post">
<asp:Datagrid runat="server"
Id="MyDataGrid"
GridLines="Both"
cellpadding="0"
cellspacing="0"
Headerstyle-BackColor="#8080C0"
Headerstyle-Font-Name="Arial"
Headerstyle-Font-Bold="True"
Headerstyle-Font-Size="14"
BackColor="#8080FF"
Font-Name="Arial"
Font-Size="11"
AlternatingItemStyle-BackColor="#C0C0C0"
AlternatingItemStyle-Font-Name="Arial"
AlternatingItemStyle-Font-Size="11"
BorderColor="Black"
AllowPaging = "True"
PageSize = "8"
PagerStyle-Mode = "NumericPages"
PagerStyle-HorizontalAlign="Center"
PagerStyle-PageButtonCount = "10"
OnPageIndexChanged = "Page_Change"
AutogenerateColumns="False"
OnDeleteCommand="MyDataGrid_DeleteCommand"
DataKeyField="id"
Width="50%">
<Columns>
<asp:ButtonColumn Text="Delete" HeaderText="Delete" CommandName="Delete"></asp:ButtonColumn>
<asp:BoundColumn DataField="fname" HeaderText="fname"></asp:BoundColumn>
<asp:BoundColumn DataField="lname" HeaderText="lname"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</form>Here is the table structure for SQL

CREATE TABLE [safetable] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[fname] [char] (10) NULL ,
[lname] [char] (10) NULL
) ON [PRIMARY]
GO
Sub Page_Change(sender As Object, e As DataGridPageChangedEventArgs)
Dim pageIndex As Integer
If e.NewPageIndex >= 0 And e.NewPageIndex < MyDataGrid.PageCount
' Valid page index.
pageIndex = e.NewPageIndex
Else If e.NamePageIndex < 0
' Move to the first page.
pageIndex = 0
Else
' Move to the last page.
pageIndex = MyDataGrid.PageCount
End If

MyDataGrid.CurrentPageIndex = pageIndex
BindData
End Sub
Thanks for your support but I am getting same error. When I am at the last page on the datagrid, there is only one record is shown. I delete that record and it is deleted successfully. Since there is no data to show on the last page of the datagird, system cannot bind it. Thats why I am getting this error. After deleting the last record on the last page of the datagrid, it should display previous page.
Same solution... :)
Move the code in the Page_Change event into a separate function, and use that function only to DataBind(), then add calls to that function in both Page_Change and MyDataGrid_DeleteCommand events.
Your solution is not clear to me! Is there any way that you can create a sample?

Thanks
It's untested, but should work.

Sub MyDataGrid_DeleteCommand(s As Object, e As DataGridCommandEventArgs )
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim DeleteCmd As String = "DELETE from safetable Where id = @.Id"
Dim MyConn as New SQLConnection(strConn)
Dim Cmd as New SqlCommand(DeleteCmd, MyConn)
Cmd.Parameters.Add(New SqlParameter("@.ID", MyDataGrid.DataKeys(CInt(e.Item.ItemIndex))))
MyConn.Open()
Cmd.ExecuteNonQuery()
MyConn.Close()
BindData
End Sub

Sub Page_Change(sender As Object, e As DataGridPageChangedEventArgs)
MyDataGrid.CurrentPageIndex = GetValidPageIndex(e.NewPageIndex)
BindData
End Sub

Sub Page_Load(Source As Object, E As EventArgs)
If Not Page.IsPostBack Then
BindData()
End If
End Sub

Sub BindData()
Dim strConn as String = "server=YourServer;uid=YourUID;pwd=YourPWD;database=YourDB"
Dim MySQL as string = "Select * from safetable Order by id desc"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)

Cmd.Fill(ds, "safetable")
With MyDataGrid
.Datasource = ds.Tables("safetable").DefaultView
.CurrentPageIndex = GetValidPageIndex(.CurrentPageIndex)
.DataBind()
End With
End Sub

Function GetValidPageIndex(ByVal intCurrentIndex As Integer) As Integer
Dim pageIndex As Integer
If e.NewPageIndex >= 0 And e.NewPageIndex < MyDataGrid.PageCount
' Valid page index.
pageIndex = e.NewPageIndex
Else If e.NamePageIndex < 0
' Move to the first page.
pageIndex = 0
Else
' Move to the last page.
pageIndex = MyDataGrid.PageCount
End If
End Function
Hi,

Is it posible that you can take a look at the your function GetValidPageIndex?. I had a error with it.
I made some modification to your function GetValidPageIndex and I still get error. Here is the code that I made modification.

Function GetValidPageIndex(ByVal intCurrentIndex As Integer) As Integer
Dim pageIndex As Integer
If intCurrentIndex >= 0 And intCurrentIndex < MyDataGrid.PageCount
' Valid page index.
GetValidPageIndex = intCurrentIndex
Else If intCurrentIndex < 0
' Move to the first page.
GetValidPageIndex = 0
Else
' Move to the last page.
GetValidPageIndex = MyDataGrid.PageCount
End If
End Function
I add following code and It worked fine.

Dim Result As Integer = MyDataGrid.Items.Count Mod MyDataGrid.PageSize

If Result = 1 Then
MyDataGrid.CurrentPageIndex = ( MyDataGrid.PageCount - 2)
End If

This is definitely a bug in IIS 6.0 and DotNet Framework 2.0!

This am I posted the following message thinking there was a problem with Dot
Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS 6.0
installed machines. I tested this on my laptop running 5.1 and Framework 2.0
and runs perfectly fine.

Can anyone from Microsoft help me. I have all our ASP.Net applications
converted 2.0 and Iam left hanging with this bug.
Jay

Hello,

We have a website running ASP.Net 1.1 using forms authentication and even
protects .htm/.doc files. We have associated such files to ASP.Net in
Application Settings.

Everything was working great until we moved to 2.0.

If we try to access a .htm page we get "Page cannot be displayed errror".
In the Application settings there are two check boxes "script engine" and
"verify that file exists" both are checked by default.

If the script engine check box is unchecked then it gives me "execute access
is
denied" error.

Why is this breaking change from 1.1 to 2.0, how do we resolve it?

Thanks.

--
Jay Balapa
www.atginc.comPlease first read this blog entry on troubleshooting.

http://blogs.msdn.com/david.wang/ar...leshooting.aspx

Realize that making random configuration changes prior to careful analysis
of the original error condition, as mentioned by the blog entry, does not
help your situation.

In your case, unchecking "Script Engine" does not help because it is the
means by which resources with Application Mappings can be executed when
Execute Permission is merely "Script" (which is the default setting). Don't
fiddle around with it nor the Execute Permission because... oh, just read
the blog entry for why.
:-)

So, please provide the log entry corresponding to the request which is
supposed to succeed but is not.

Now, since you are using non-standard configuration, also provide any
non-default Application mapping modifications as well as
web.config/machine.config modifications to make your current application
work.

In particular, are you seeing the failure on all content types mapped to
aspnet_isapi.dll or just .htm/.doc.

Since mapping non dot-net content to aspnet_isapi.dll to be protected by
Forms Authentication is not exactly the normal/default scenario, some things
actually did change on upgrade... But we need to first confirm your custom
configuration.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"Jay Balapa" <jbalapa@.atginc.com> wrote in message
news:eRJ$8MmFGHA.216@.TK2MSFTNGP15.phx.gbl...
> This am I posted the following message thinking there was a problem with
> Dot Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS
> 6.0 installed machines. I tested this on my laptop running 5.1 and
> Framework 2.0 and runs perfectly fine.
> Can anyone from Microsoft help me. I have all our ASP.Net applications
> converted 2.0 and Iam left hanging with this bug.
> Jay
>
> Hello,
> We have a website running ASP.Net 1.1 using forms authentication and even
> protects .htm/.doc files. We have associated such files to ASP.Net in
> Application Settings.
>
> Everything was working great until we moved to 2.0.
> If we try to access a .htm page we get "Page cannot be displayed errror".
> In the Application settings there are two check boxes "script engine" and
> "verify that file exists" both are checked by default.
>
> If the script engine check box is unchecked then it gives me "execute
> access
> is
> denied" error.
> Why is this breaking change from 1.1 to 2.0, how do we resolve it?
> Thanks.
> --
> Jay Balapa
> www.atginc.com
>
For the request in question, what is being logged in the IIS logfile? Please
post the relevant entry/entries.

Thanks

Cheers
Ken

"Jay Balapa" <jbalapa@.atginc.com> wrote in message
news:eRJ$8MmFGHA.216@.TK2MSFTNGP15.phx.gbl...
: This am I posted the following message thinking there was a problem with
Dot
: Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS 6.0
: installed machines. I tested this on my laptop running 5.1 and Framework
2.0
: and runs perfectly fine.
:
: Can anyone from Microsoft help me. I have all our ASP.Net applications
: converted 2.0 and Iam left hanging with this bug.
: Jay
:
:
:
: Hello,
:
: We have a website running ASP.Net 1.1 using forms authentication and even
: protects .htm/.doc files. We have associated such files to ASP.Net in
: Application Settings.
:
:
: Everything was working great until we moved to 2.0.
:
: If we try to access a .htm page we get "Page cannot be displayed errror".
: In the Application settings there are two check boxes "script engine" and
: "verify that file exists" both are checked by default.
:
:
: If the script engine check box is unchecked then it gives me "execute
access
: is
: denied" error.
:
: Why is this breaking change from 1.1 to 2.0, how do we resolve it?
:
: Thanks.
:
: --
: Jay Balapa
: www.atginc.com
:
:
:
:
Ken and David,

Thanks for replying to my post.

***************************************888
> So, please provide the log entry corresponding to the request which is
> supposed to succeed but is not.
**********************************************88
Here are the log file entries- First entry is the aspx entry second is the
..htm entry not working.

2006-01-11 15:17:02 W3SVC1 10.0.0.32 POST /login.aspx - 80 - 10.0.0.163
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.N ET+CLR+1.1.4322;+.NET+CLR+1.0.3705;+.NET+CLR+2.0.5 0727)
302 0 0
2006-01-11 15:17:02 W3SVC1 10.0.0.32 GET /clients/vipdemo/gateway.htm - 80 -
10.0.0.163
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.N ET+CLR+1.1.4322;+.NET+CLR+1.0.3705;+.NET+CLR+2.0.5 0727)
200 0 0

********************************************
> web.config/machine.config modifications to make your current application
> work.
***********************************************8

We just followed the default forms authentication guidelines, following are
the entries-
In the root folder this was the entry-
<system.web>
<sessionState mode="InProc" cookieless="true" />
<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>
<authentication mode="Forms">
<forms loginUrl="login.aspx" protection="All" />
</authentication>
<customErrors mode="Off"/>
</system.web
In the sub folder where we need protection we have this at the root-

<system.web>
<authorization>
<deny users="?"></deny>
</authorization>
</system.web
************************************************** ****888
> In particular, are you seeing the failure on all content types mapped to
> aspnet_isapi.dll or just .htm/.doc.
************************************************** **********
Iam only seeing failure on mapped files like .htm/.doc. There are no issues
with aspx files. If I take the mapping off everything works great, but
files are not protected.

Thanks again for all your help.

jay Balapa
www.atginc.com

"David Wang [Msft]" <someone@.online.microsoft.com> wrote in message
news:OQpGhynFGHA.3000@.TK2MSFTNGP14.phx.gbl...
> Please first read this blog entry on troubleshooting.
> http://blogs.msdn.com/david.wang/ar...leshooting.aspx
> Realize that making random configuration changes prior to careful analysis
> of the original error condition, as mentioned by the blog entry, does not
> help your situation.
> In your case, unchecking "Script Engine" does not help because it is the
> means by which resources with Application Mappings can be executed when
> Execute Permission is merely "Script" (which is the default setting).
> Don't fiddle around with it nor the Execute Permission because... oh, just
> read the blog entry for why.
> :-)
> So, please provide the log entry corresponding to the request which is
> supposed to succeed but is not.
> Now, since you are using non-standard configuration, also provide any
> non-default Application mapping modifications as well as
> web.config/machine.config modifications to make your current application
> work.
> In particular, are you seeing the failure on all content types mapped to
> aspnet_isapi.dll or just .htm/.doc.
> Since mapping non dot-net content to aspnet_isapi.dll to be protected by
> Forms Authentication is not exactly the normal/default scenario, some
> things actually did change on upgrade... But we need to first confirm your
> custom configuration.
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Jay Balapa" <jbalapa@.atginc.com> wrote in message
> news:eRJ$8MmFGHA.216@.TK2MSFTNGP15.phx.gbl...
>> This am I posted the following message thinking there was a problem with
>> Dot Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS
>> 6.0 installed machines. I tested this on my laptop running 5.1 and
>> Framework 2.0 and runs perfectly fine.
>>
>> Can anyone from Microsoft help me. I have all our ASP.Net applications
>> converted 2.0 and Iam left hanging with this bug.
>> Jay
>>
>>
>>
>> Hello,
>>
>> We have a website running ASP.Net 1.1 using forms authentication and even
>> protects .htm/.doc files. We have associated such files to ASP.Net in
>> Application Settings.
>>
>>
>> Everything was working great until we moved to 2.0.
>>
>> If we try to access a .htm page we get "Page cannot be displayed errror".
>> In the Application settings there are two check boxes "script engine" and
>> "verify that file exists" both are checked by default.
>>
>>
>> If the script engine check box is unchecked then it gives me "execute
>> access
>> is
>> denied" error.
>>
>> Why is this breaking change from 1.1 to 2.0, how do we resolve it?
>>
>> Thanks.
>>
>> --
>> Jay Balapa
>> www.atginc.com
>>
>>
>>
>>
The log entry says that IIS handed the request to ASP.Net, so there is no
bug in IIS6 portion. I do not think there is a bug in the ASP.Net portion,
either, because I've used ASP.Net 2.0 to protect non-.Net content before
with no problems.

Is there anything in your .config file which prevents .htm or .doc from
being served by ASP.Net. In particular, what does your upgraded
machine.config look like for the httpHandler section -- is it actually
configured to serve the resources you are talking about.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"Jay Balapa" <jbalapa@.atginc.com> wrote in message
news:OGtEYRsFGHA.524@.TK2MSFTNGP09.phx.gbl...
> Ken and David,
> Thanks for replying to my post.
>
> ***************************************888
>> So, please provide the log entry corresponding to the request which is
>> supposed to succeed but is not.
> **********************************************88
> Here are the log file entries- First entry is the aspx entry second is the
> .htm entry not working.
> 2006-01-11 15:17:02 W3SVC1 10.0.0.32 POST /login.aspx - 80 - 10.0.0.163
> Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.N ET+CLR+1.1.4322;+.NET+CLR+1.0.3705;+.NET+CLR+2.0.5 0727)
> 302 0 0
> 2006-01-11 15:17:02 W3SVC1 10.0.0.32 GET /clients/vipdemo/gateway.htm -
> 80 - 10.0.0.163
> Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.N ET+CLR+1.1.4322;+.NET+CLR+1.0.3705;+.NET+CLR+2.0.5 0727)
> 200 0 0
>
>
> ********************************************
>> web.config/machine.config modifications to make your current application
>> work.
> ***********************************************8
> We just followed the default forms authentication guidelines, following
> are the entries-
> In the root folder this was the entry-
> <system.web>
> <sessionState mode="InProc" cookieless="true" />
> <trace enabled="true" requestLimit="10" pageOutput="true"
> traceMode="SortByTime" localOnly="true"/>
> <authentication mode="Forms">
> <forms loginUrl="login.aspx" protection="All" />
> </authentication>
> <customErrors mode="Off"/>
> </system.web>
> In the sub folder where we need protection we have this at the root-
> <system.web>
> <authorization>
> <deny users="?"></deny>
> </authorization>
> </system.web>
>
> ************************************************** ****888
>> In particular, are you seeing the failure on all content types mapped to
>> aspnet_isapi.dll or just .htm/.doc.
> ************************************************** **********
> Iam only seeing failure on mapped files like .htm/.doc. There are no
> issues with aspx files. If I take the mapping off everything works great,
> but files are not protected.
> Thanks again for all your help.
> jay Balapa
> www.atginc.com
>
>
>
>
>
>
>
>
> "David Wang [Msft]" <someone@.online.microsoft.com> wrote in message
> news:OQpGhynFGHA.3000@.TK2MSFTNGP14.phx.gbl...
>> Please first read this blog entry on troubleshooting.
>>
>> http://blogs.msdn.com/david.wang/ar...leshooting.aspx
>>
>> Realize that making random configuration changes prior to careful
>> analysis of the original error condition, as mentioned by the blog entry,
>> does not help your situation.
>>
>> In your case, unchecking "Script Engine" does not help because it is the
>> means by which resources with Application Mappings can be executed when
>> Execute Permission is merely "Script" (which is the default setting).
>> Don't fiddle around with it nor the Execute Permission because... oh,
>> just read the blog entry for why.
>> :-)
>>
>> So, please provide the log entry corresponding to the request which is
>> supposed to succeed but is not.
>>
>> Now, since you are using non-standard configuration, also provide any
>> non-default Application mapping modifications as well as
>> web.config/machine.config modifications to make your current application
>> work.
>>
>> In particular, are you seeing the failure on all content types mapped to
>> aspnet_isapi.dll or just .htm/.doc.
>>
>> Since mapping non dot-net content to aspnet_isapi.dll to be protected by
>> Forms Authentication is not exactly the normal/default scenario, some
>> things actually did change on upgrade... But we need to first confirm
>> your custom configuration.
>>
>> --
>> //David
>> IIS
>> http://blogs.msdn.com/David.Wang
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> //
>>
>> "Jay Balapa" <jbalapa@.atginc.com> wrote in message
>> news:eRJ$8MmFGHA.216@.TK2MSFTNGP15.phx.gbl...
>>> This am I posted the following message thinking there was a problem with
>>> Dot Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS
>>> 6.0 installed machines. I tested this on my laptop running 5.1 and
>>> Framework 2.0 and runs perfectly fine.
>>>
>>> Can anyone from Microsoft help me. I have all our ASP.Net applications
>>> converted 2.0 and Iam left hanging with this bug.
>>> Jay
>>>
>>>
>>>
>>> Hello,
>>>
>>> We have a website running ASP.Net 1.1 using forms authentication and
>>> even
>>> protects .htm/.doc files. We have associated such files to ASP.Net in
>>> Application Settings.
>>>
>>>
>>> Everything was working great until we moved to 2.0.
>>>
>>> If we try to access a .htm page we get "Page cannot be displayed
>>> errror".
>>> In the Application settings there are two check boxes "script engine"
>>> and
>>> "verify that file exists" both are checked by default.
>>>
>>>
>>> If the script engine check box is unchecked then it gives me "execute
>>> access
>>> is
>>> denied" error.
>>>
>>> Why is this breaking change from 1.1 to 2.0, how do we resolve it?
>>>
>>> Thanks.
>>>
>>> --
>>> Jay Balapa
>>> www.atginc.com
>>>
>>>
>>>
>>>
>>
>>
I'm seeing this same problem with IIS 6 and ASP.NET 2.0 as well. On my
test machine, which has IIS 5.1, I can map htm files to ASP.NET 2.0 and
it works fine but when I move my app to the production server running
IIS 6 and configure the virtual directory to send htm files to ASP.NET
2.0 the files are not served. When I check the log files I see the
request comes in but zero bytes are sent out, no headers, nothing. I'm
not aware of any configuring being done to the server either as we just
installed .NET 2.0 on Monday and I'm the one primarily using it. I
should mention ASP.NET 1.1 on the same server can send htm files
without problem, it's only ASP.NET 2.0 and only on IIS 6 where the
problem occurs. Does anyone have any insight into this?
If you have 1.1 on the same W2K3 Server as the 2.0, you have to run the
ASP.NET in separate application pools. In IIS, create a new application
pool and then through the Properties dialog of your web app using 2.0,
change to the new application pool.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

<zzhumphreyt@.gmail.com> wrote in message
news:1138804187.904844.308490@.f14g2000cwb.googlegr oups.com...
> I'm seeing this same problem with IIS 6 and ASP.NET 2.0 as well. On my
> test machine, which has IIS 5.1, I can map htm files to ASP.NET 2.0 and
> it works fine but when I move my app to the production server running
> IIS 6 and configure the virtual directory to send htm files to ASP.NET
> 2.0 the files are not served. When I check the log files I see the
> request comes in but zero bytes are sent out, no headers, nothing. I'm
> not aware of any configuring being done to the server either as we just
> installed .NET 2.0 on Monday and I'm the one primarily using it. I
> should mention ASP.NET 1.1 on the same server can send htm files
> without problem, it's only ASP.NET 2.0 and only on IIS 6 where the
> problem occurs. Does anyone have any insight into this?
I did that. I was looking into this more and discovered the default
web.config for htm files in 2.0 is set to the
System.Web.DefaultHttpHandler class. I used WinMerge to compare the
default web.config on the server to the one on my machine and they're
the same. Since this class wasn't working I was looking at other
httpHandlers in the config and saw the System.Web.StaticFileHandler
being used for some files. I added lines in my app's web.config to set
htm files to that and everything started working. I'm glad I'm found a
solution but I'm still confused why I would even need to do this in the
first place since the default config works on my machine but not the
server. I have ASP.NET 1.1 on my machine too, just like the server.
I'm at a loss and still inclined to believe there's a bug or something
screwy between ASP.NET 2.0 and IIS 6, or rather the
System.Web.DefaultHttpHandler class acts differently in this
environment than in others.

But to recap, if this can help others, I added these lines to my own
app's web.config file, I didn't touch the default web.config file here
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONF IG\web.config because
I didn't want to affect other app's on the server.

<httpHandlers>
<add path="*.htm" verb="*" type="System.Web.StaticFileHandler"
validate="True" />
<add path="*.html" verb="*" type="System.Web.StaticFileHandler"
validate="True" />
</httpHandlers
Actually, DefaultHttpHandler has to act differently between IIS5.1 on XP Pro
and IIS6 on WS03 because of new functionality. The new functionality made
some of the old configuration not work (but others work even better), but I
think you'll find the new alternatives more powerful.

What you describe would work if you mapped .* instead of .htm to
ASPNET_ISAPI.DLL. With IIS6 and ASP.Net it is no longer necessary to
pick-and-choose the scriptmapping up-front. DefaultHttpHandler is able to
hand the request *back* to IIS6 for processing. How is this useful?

On ASP.Net 1.1, people liked to map content to ASP.Net to apply forms auth
to them. Unfortunately, ASP.Net 1.1 had no way to hand the request back to
IIS, so this only worked for static content; you could not apply ASP.Net
forms auth to ASP content and still have that page correctly process as ASP.
Thus it is necessary to pick-and-choose the extensions to configure
Application Mappings. Well on ASP.Net and IIS6, you *can* with the
DefaultHttpHandler and it works by default... it you configure
ASPNET_ISAPI.DLL as the wildcard application mapping.

Put another way - now that DefaultHttpHandler is able to hand requests back
to IIS it is now possible to setup infinite loops for request processing.
You found one of them - map .htm to ASPNET_ISAPI.DLL and then make a request
to .htm resource, which is routed to ASPNET_ISAPI.DLL, which has no
HttpHandler for .htm and falls through to DefaultHttpHandler, who hands the
request back to IIS, who routes .htm to ASPNET_ISAPI.DLL... and you have a
loop.

What you did, map .htm to StaticFileHandler , works because it breaks the
loop, but it is not as efficient as mapping .* to ASPNET_ISAPI.DLL, letting
DefaultHttpHandler route that request back to IIS, who has special logic to
break loops for wildcard application mappings... which then allows you to
take advantage of the native Static File Handler.

The entire area of applying ASP.Net HttpModule/HttpHandler to non-ASP.Net
resource and reconciling IIS ScriptMaps and HttpHandler is currently
confusing unless you understand both IIS and ASP.Net architecture (or you
just blindly follow whatever people seem to be doing)... and it is something
we are addressing in a unified approach in IIS7.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

<zzhumphreyt@.gmail.com> wrote in message
news:1138890016.293264.70150@.g47g2000cwa.googlegro ups.com...
>I did that. I was looking into this more and discovered the default
> web.config for htm files in 2.0 is set to the
> System.Web.DefaultHttpHandler class. I used WinMerge to compare the
> default web.config on the server to the one on my machine and they're
> the same. Since this class wasn't working I was looking at other
> httpHandlers in the config and saw the System.Web.StaticFileHandler
> being used for some files. I added lines in my app's web.config to set
> htm files to that and everything started working. I'm glad I'm found a
> solution but I'm still confused why I would even need to do this in the
> first place since the default config works on my machine but not the
> server. I have ASP.NET 1.1 on my machine too, just like the server.
> I'm at a loss and still inclined to believe there's a bug or something
> screwy between ASP.NET 2.0 and IIS 6, or rather the
> System.Web.DefaultHttpHandler class acts differently in this
> environment than in others.
> But to recap, if this can help others, I added these lines to my own
> app's web.config file, I didn't touch the default web.config file here
> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONF IG\web.config because
> I didn't want to affect other app's on the server.
> <httpHandlers>
> <add path="*.htm" verb="*" type="System.Web.StaticFileHandler"
> validate="True" />
> <add path="*.html" verb="*" type="System.Web.StaticFileHandler"
> validate="True" />
> </httpHandlers

This is definitely a bug in IIS 6.0 and DotNet Framework 2.0!

This am I posted the following message thinking there was a problem with Dot
Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS 6.0
installed machines. I tested this on my laptop running 5.1 and Framework 2.0
and runs perfectly fine.
Can anyone from Microsoft help me. I have all our ASP.Net applications
converted 2.0 and Iam left hanging with this bug.
Jay
Hello,
We have a website running ASP.Net 1.1 using forms authentication and even
protects .htm/.doc files. We have associated such files to ASP.Net in
Application Settings.
Everything was working great until we moved to 2.0.
If we try to access a .htm page we get "Page cannot be displayed errror".
In the Application settings there are two check boxes "script engine" and
"verify that file exists" both are checked by default.
If the script engine check box is unchecked then it gives me "execute access
is
denied" error.
Why is this breaking change from 1.1 to 2.0, how do we resolve it?
Thanks.
Jay Balapa
www.atginc.comFor the request in question, what is being logged in the IIS logfile? Please
post the relevant entry/entries.
Thanks
Cheers
Ken
"Jay Balapa" <jbalapa@.atginc.com> wrote in message
news:eRJ$8MmFGHA.216@.TK2MSFTNGP15.phx.gbl...
: This am I posted the following message thinking there was a problem with
Dot
: Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS 6.0
: installed machines. I tested this on my laptop running 5.1 and Framework
2.0
: and runs perfectly fine.
:
: Can anyone from Microsoft help me. I have all our ASP.Net applications
: converted 2.0 and Iam left hanging with this bug.
: Jay
:
:
:
: Hello,
:
: We have a website running ASP.Net 1.1 using forms authentication and even
: protects .htm/.doc files. We have associated such files to ASP.Net in
: Application Settings.
:
:
: Everything was working great until we moved to 2.0.
:
: If we try to access a .htm page we get "Page cannot be displayed errror".
: In the Application settings there are two check boxes "script engine" and
: "verify that file exists" both are checked by default.
:
:
: If the script engine check box is unchecked then it gives me "execute
access
: is
: denied" error.
:
: Why is this breaking change from 1.1 to 2.0, how do we resolve it?
:
: Thanks.
:
: --
: Jay Balapa
: www.atginc.com
:
:
:
:
Please first read this blog entry on troubleshooting.
http://blogs.msdn.com/david.wang/ar.../>
ooting.aspx
Realize that making random configuration changes prior to careful analysis
of the original error condition, as mentioned by the blog entry, does not
help your situation.
In your case, unchecking "Script Engine" does not help because it is the
means by which resources with Application Mappings can be executed when
Execute Permission is merely "Script" (which is the default setting). Don't
fiddle around with it nor the Execute Permission because... oh, just read
the blog entry for why.
:-)
So, please provide the log entry corresponding to the request which is
supposed to succeed but is not.
Now, since you are using non-standard configuration, also provide any
non-default Application mapping modifications as well as
web.config/machine.config modifications to make your current application
work.
In particular, are you seeing the failure on all content types mapped to
aspnet_isapi.dll or just .htm/.doc.
Since mapping non dot-net content to aspnet_isapi.dll to be protected by
Forms Authentication is not exactly the normal/default scenario, some things
actually did change on upgrade... But we need to first confirm your custom
configuration.
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Jay Balapa" <jbalapa@.atginc.com> wrote in message
news:eRJ$8MmFGHA.216@.TK2MSFTNGP15.phx.gbl...
> This am I posted the following message thinking there was a problem with
> Dot Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS
> 6.0 installed machines. I tested this on my laptop running 5.1 and
> Framework 2.0 and runs perfectly fine.
> Can anyone from Microsoft help me. I have all our ASP.Net applications
> converted 2.0 and Iam left hanging with this bug.
> Jay
>
> Hello,
> We have a website running ASP.Net 1.1 using forms authentication and even
> protects .htm/.doc files. We have associated such files to ASP.Net in
> Application Settings.
>
> Everything was working great until we moved to 2.0.
> If we try to access a .htm page we get "Page cannot be displayed errror".
> In the Application settings there are two check boxes "script engine" and
> "verify that file exists" both are checked by default.
>
> If the script engine check box is unchecked then it gives me "execute
> access
> is
> denied" error.
> Why is this breaking change from 1.1 to 2.0, how do we resolve it?
> Thanks.
> --
> Jay Balapa
> www.atginc.com
>
>
Ken and David,
Thanks for replying to my post.
***************************************8
88
> So, please provide the log entry corresponding to the request which is
> supposed to succeed but is not.
****************************************
******88
Here are the log file entries- First entry is the aspx entry second is the
.htm entry not working.
2006-01-11 15:17:02 W3SVC1 10.0.0.32 POST /login.aspx - 80 - 10.0.0.163
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322;+.
NET+CLR+1.0.3705;+.NET+CLR+2.0.50727)
302 0 0
2006-01-11 15:17:02 W3SVC1 10.0.0.32 GET /clients/vipdemo/gateway.htm - 80 -
10.0.0.163
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322;+.
NET+CLR+1.0.3705;+.NET+CLR+2.0.50727)
200 0 0
****************************************
****
> web.config/machine.config modifications to make your current application
> work.
****************************************
*******8
We just followed the default forms authentication guidelines, following are
the entries-
In the root folder this was the entry-
<system.web>
<sessionState mode="InProc" cookieless="true" />
<trace enabled="true" requestLimit="10" pageOutput="true"
traceMode="SortByTime" localOnly="true"/>
<authentication mode="Forms">
<forms loginUrl="login.aspx" protection="All" />
</authentication>
<customErrors mode="Off"/>
</system.web>
In the sub folder where we need protection we have this at the root-
<system.web>
<authorization>
<deny users="?"></deny>
</authorization>
</system.web>
****************************************
**************888
> In particular, are you seeing the failure on all content types mapped to
> aspnet_isapi.dll or just .htm/.doc.
****************************************
********************
Iam only seeing failure on mapped files like .htm/.doc. There are no issues
with aspx files. If I take the mapping off everything works great, but
files are not protected.
Thanks again for all your help.
jay Balapa
www.atginc.com

"David Wang [Msft]" <someone@.online.microsoft.com> wrote in message
news:OQpGhynFGHA.3000@.TK2MSFTNGP14.phx.gbl...
> Please first read this blog entry on troubleshooting.
> http://blogs.msdn.com/david.wang/ar...
shooting.aspx
> Realize that making random configuration changes prior to careful analysis
> of the original error condition, as mentioned by the blog entry, does not
> help your situation.
> In your case, unchecking "Script Engine" does not help because it is the
> means by which resources with Application Mappings can be executed when
> Execute Permission is merely "Script" (which is the default setting).
> Don't fiddle around with it nor the Execute Permission because... oh, just
> read the blog entry for why.
> :-)
> So, please provide the log entry corresponding to the request which is
> supposed to succeed but is not.
> Now, since you are using non-standard configuration, also provide any
> non-default Application mapping modifications as well as
> web.config/machine.config modifications to make your current application
> work.
> In particular, are you seeing the failure on all content types mapped to
> aspnet_isapi.dll or just .htm/.doc.
> Since mapping non dot-net content to aspnet_isapi.dll to be protected by
> Forms Authentication is not exactly the normal/default scenario, some
> things actually did change on upgrade... But we need to first confirm your
> custom configuration.
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Jay Balapa" <jbalapa@.atginc.com> wrote in message
> news:eRJ$8MmFGHA.216@.TK2MSFTNGP15.phx.gbl...
>
The log entry says that IIS handed the request to ASP.Net, so there is no
bug in IIS6 portion. I do not think there is a bug in the ASP.Net portion,
either, because I've used ASP.Net 2.0 to protect non-.Net content before
with no problems.
Is there anything in your .config file which prevents .htm or .doc from
being served by ASP.Net. In particular, what does your upgraded
machine.config look like for the httpHandler section -- is it actually
configured to serve the resources you are talking about.
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Jay Balapa" <jbalapa@.atginc.com> wrote in message
news:OGtEYRsFGHA.524@.TK2MSFTNGP09.phx.gbl...
> Ken and David,
> Thanks for replying to my post.
>
> ***************************************8
88
> ****************************************
******88
> Here are the log file entries- First entry is the aspx entry second is the
> .htm entry not working.
> 2006-01-11 15:17:02 W3SVC1 10.0.0.32 POST /login.aspx - 80 - 10.0.0.163
> Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322;
+.NET+CLR+1.0.3705;+.NET+CLR+2.0.50727)
> 302 0 0
> 2006-01-11 15:17:02 W3SVC1 10.0.0.32 GET /clients/vipdemo/gateway.htm -
> 80 - 10.0.0.163
> Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322;
+.NET+CLR+1.0.3705;+.NET+CLR+2.0.50727)
> 200 0 0
>
>
> ****************************************
****
> ****************************************
*******8
> We just followed the default forms authentication guidelines, following
> are the entries-
> In the root folder this was the entry-
> <system.web>
> <sessionState mode="InProc" cookieless="true" />
> <trace enabled="true" requestLimit="10" pageOutput="true"
> traceMode="SortByTime" localOnly="true"/>
> <authentication mode="Forms">
> <forms loginUrl="login.aspx" protection="All" />
> </authentication>
> <customErrors mode="Off"/>
> </system.web>
> In the sub folder where we need protection we have this at the root-
> <system.web>
> <authorization>
> <deny users="?"></deny>
> </authorization>
> </system.web>
>
> ****************************************
**************888
> ****************************************
********************
> Iam only seeing failure on mapped files like .htm/.doc. There are no
> issues with aspx files. If I take the mapping off everything works great,
> but files are not protected.
> Thanks again for all your help.
> jay Balapa
> www.atginc.com
>
>
>
>
>
>
>
>
> "David Wang [Msft]" <someone@.online.microsoft.com> wrote in message
> news:OQpGhynFGHA.3000@.TK2MSFTNGP14.phx.gbl...
>

Saturday, March 24, 2012

this.Connection.Close(); does not close the Oracle session! Pleasehelp!

Hi all!

I'm writing an ASP.NET web application that uses an Oracle database.

I OPEN the Oracle connection by using the following code:

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}

I then create the command object by using the following:

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.

I then CLOSE the connection by using the
this.Connection.Close(); command.

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!

Thanks
SteveI'm pretty sure "OracleConnection" is not a standard Framework class. You'll
probably have better luck asking the component vendor (or in their forums).
My guess is that it has to do with connection pooling. Do the number of
connections grow endlessly, or are they reused over and over? If it's the
later, then you should actually have a very happy DBA.

Scott

"S_K" <steve_kershaw@.yahoo.comwrote in message
news:3619d1f2-ef79-41cb-a0af-5df58dd223a0@.e10g2000prf.googlegroups.com...

Quote:

Originally Posted by

Hi all!
>
I'm writing an ASP.NET web application that uses an Oracle database.
>
I OPEN the Oracle connection by using the following code:
>
if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}
>
I then create the command object by using the following:
>
OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
>
I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.
>
I then CLOSE the connection by using the
this.Connection.Close(); command.
>
However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!
>
Thanks
Steve


Did you close the reader?

if(null!=reader)
{
reader.Close();
}

?

A reader is a live firehouse...thus you use it, then you tidy up.
You can't get reader, close the connection , then use the reader. That
doesn't make sense.

Use the reader as quickly as possible, then close it.

"S_K" <steve_kershaw@.yahoo.comwrote in message
news:3619d1f2-ef79-41cb-a0af-5df58dd223a0@.e10g2000prf.googlegroups.com...

Quote:

Originally Posted by

Hi all!
>
I'm writing an ASP.NET web application that uses an Oracle database.
>
I OPEN the Oracle connection by using the following code:
>
if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}
>
I then create the command object by using the following:
>
OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
>
I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.
>
I then CLOSE the connection by using the
this.Connection.Close(); command.
>
However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!
>
Thanks
Steve


you will need to turn connection pooling off (see your connect string
properties). with pooling on, connection.close only returns the connection to
the pool, it does not close it. you may make your dba happy by lowing the
pool timeout.

-- bruce (sqlwork.com)

"S_K" wrote:

Quote:

Originally Posted by

Hi all!
>
I'm writing an ASP.NET web application that uses an Oracle database.
>
I OPEN the Oracle connection by using the following code:
>
if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}
>
I then create the command object by using the following:
>
OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
>
I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.
>
I then CLOSE the connection by using the
this.Connection.Close(); command.
>
However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!
>
Thanks
Steve
>


On Dec 6, 3:13 pm, bruce barker
<brucebar...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

you will need to turn connection pooling off (see your connect string
properties). with pooling on, connection.close only returns the connection to
the pool, it does not close it. you may make your dba happy by lowing the
pool timeout.
>
-- bruce (sqlwork.com)
>
>
>
"S_K" wrote:

Quote:

Originally Posted by

Hi all!


>

Quote:

Originally Posted by

I'm writing an ASP.NET web application that uses an Oracle database.


>

Quote:

Originally Posted by

I OPEN the Oracle connection by using the following code:


>

Quote:

Originally Posted by

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}


>

Quote:

Originally Posted by

I then create the command object by using the following:


>

Quote:

Originally Posted by

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;


>

Quote:

Originally Posted by

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.


>

Quote:

Originally Posted by

I then CLOSE the connection by using the
this.Connection.Close(); command.


>

Quote:

Originally Posted by

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!


>

Quote:

Originally Posted by

Thanks
Steve- Hide quoted text -


>
- Show quoted text -


I don't actually CLOSE the reader but I DO Dispose the reader:
reader.Dispose();

Doesn't that close the reader as well?

Also, how do you turn off the connection pooling in the connection
string? All I have is the basic connection string.

Thanks for your quick replies.

Steve
no, dispose will return it to the pool if pooling is enabled (all dispose
does is call close if needed).

you will need the connection string settings docs for the driver you are
using..

-- bruce (sqlwork.com)

"S_K" wrote:

Quote:

Originally Posted by

On Dec 6, 3:13 pm, bruce barker
<brucebar...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

you will need to turn connection pooling off (see your connect string
properties). with pooling on, connection.close only returns the connection to
the pool, it does not close it. you may make your dba happy by lowing the
pool timeout.

-- bruce (sqlwork.com)

"S_K" wrote:

Quote:

Originally Posted by

Hi all!


Quote:

Originally Posted by

I'm writing an ASP.NET web application that uses an Oracle database.


Quote:

Originally Posted by

I OPEN the Oracle connection by using the following code:


Quote:

Originally Posted by

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}


Quote:

Originally Posted by

I then create the command object by using the following:


Quote:

Originally Posted by

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;


Quote:

Originally Posted by

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.


Quote:

Originally Posted by

I then CLOSE the connection by using the
this.Connection.Close(); command.


Quote:

Originally Posted by

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!


Quote:

Originally Posted by

Thanks
Steve- Hide quoted text -


- Show quoted text -


>
I don't actually CLOSE the reader but I DO Dispose the reader:
reader.Dispose();
>
Doesn't that close the reader as well?
>
Also, how do you turn off the connection pooling in the connection
string? All I have is the basic connection string.
>
Thanks for your quick replies.
>
Steve
>


OracleConnection is in the System.Data.OracleClient namespace.

Although Oracle also provides such a class, in their
Oracle.DataAccess.Client namespace.

If the connection pool advice doesn't work out, try also calling
Dispose on the connection. Unless the issue has been resolved in a
recent version, there's a flaw in the Framework class that
necessitates this. And it can't hurt in any event.

On Dec 6, 4:52 pm, "Scott Roberts" <srobe...@.no.spam.here-webworks-
software.comwrote:

Quote:

Originally Posted by

I'm pretty sure "OracleConnection" is not a standard Framework class. You'll
probably have better luck asking the component vendor (or in their forums).
My guess is that it has to do with connection pooling. Do the number of
connections grow endlessly, or are they reused over and over? If it's the
later, then you should actually have a very happy DBA.
>
Scott
>
"S_K" <steve_kers...@.yahoo.comwrote in message
>
news:3619d1f2-ef79-41cb-a0af-5df58dd223a0@.e10g2000prf.googlegroups.com...
>
>
>

Quote:

Originally Posted by

Hi all!


>

Quote:

Originally Posted by

I'm writing an ASP.NET web application that uses an Oracle database.


>

Quote:

Originally Posted by

I OPEN the Oracle connection by using the following code:


>

Quote:

Originally Posted by

if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}


>

Quote:

Originally Posted by

I then create the command object by using the following:


>

Quote:

Originally Posted by

OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;


>

Quote:

Originally Posted by

I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.


>

Quote:

Originally Posted by

I then CLOSE the connection by using the
this.Connection.Close(); command.


>

Quote:

Originally Posted by

However, the sessions stay active!!!
I have a very angry DBA on my tail about this one!
Please help!


>

Quote:

Originally Posted by

Thanks
Steve- Hide quoted text -


>
- Show quoted text -

this.Connection.Close(); does not close the Oracle session! Please

Hi all!
I'm writing an ASP.NET web application that uses an Oracle database.
I OPEN the Oracle connection by using the following code:
if (this.ConnectionString != "")
{
this.Connection = new OracleConnection(this.ConnectionString);
this.Connection.Open();
return;
}
I then create the command object by using the following:
OracleCommand DBCmd = new
OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
objConnect.Connection);
DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
I then I run the OracleCommand.ExecuteReader method to execute the
stored procedure.
I then CLOSE the connection by using the
this.Connection.Close(); command.
However, the sessions stay active!!!
I have a very DBA on my tail about this one!
Please help!
Thanks
Steveyou will need to turn connection pooling off (see your connect string
properties). with pooling on, connection.close only returns the connection t
o
the pool, it does not close it. you may make your dba happy by lowing the
pool timeout.
-- bruce (sqlwork.com)
"S_K" wrote:

> Hi all!
> I'm writing an ASP.NET web application that uses an Oracle database.
> I OPEN the Oracle connection by using the following code:
> if (this.ConnectionString != "")
> {
> this.Connection = new OracleConnection(this.ConnectionString);
> this.Connection.Open();
> return;
> }
> I then create the command object by using the following:
> OracleCommand DBCmd = new
> OracleCommand("PRL_STORE_PAYMENT_REQ_PKG.GET_PAYMENT_REQ_LOOKUP",
> objConnect.Connection);
> DBCmd.CommandType = System.Data.CommandType.StoredProcedure;
> I then I run the OracleCommand.ExecuteReader method to execute the
> stored procedure.
> I then CLOSE the connection by using the
> this.Connection.Close(); command.
> However, the sessions stay active!!!
> I have a very DBA on my tail about this one!
> Please help!
> Thanks
> Steve
>

this.Controls.Add(Control) Does Not Add Control to child collection (this.Controls.Count =

Ok, as silly as it may sound, I have a situation where I am creating a
CompositeControl in ASP.NET 2.0, C#. I have the following code in the
CreateChildControls() method that build the control's child control
collection:

for (int i = 0; i < _menus.Count; i++)
this.Controls.Add(_menus[i]);

foreach (FloatingMenu menu in _menus)
{
Label lbl = new Label();
lbl.ID = string.Concat("GroupQ", menu.ID);
lbl.CssClass = "menuItemGroupHeader";
lbl.Text = menu.GroupName;
this.Controls.Add(lbl);

HoverMenuExtender extender = new HoverMenuExtender();
extender.ID = string.Concat("ExtenderQ", menu.ID);
extender.TargetControlID = lbl.ID;
extender.PopupControlID = menu.ID;
extender.PopupPosition = HoverMenuPopupPosition.Bottom;
this.Controls.Add(extender);
}

The amazing thing is here, that the Label control and the HoverMenuExtender
AJAX Toolkit control both get added just fine, however I added a watch on
this.Controls.Count for the line where I add my FloatingMenu control
collection, "_menus", and after each call to "this.Controls.Add(_menus[i]);"
the Count is 0, however after I add the label it's 1 and the extender it's
2.

I'm stumped.

Thanks,
ChadWhat is the value of _menus.Count before the for loop

"Chad Scharf" <chadscharf@.community.nospamwrote in message
news:%23qrSW5CEIHA.5752@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Ok, as silly as it may sound, I have a situation where I am creating a
CompositeControl in ASP.NET 2.0, C#. I have the following code in the
CreateChildControls() method that build the control's child control
collection:
>
for (int i = 0; i < _menus.Count; i++)
this.Controls.Add(_menus[i]);
>
foreach (FloatingMenu menu in _menus)
{
Label lbl = new Label();
lbl.ID = string.Concat("GroupQ", menu.ID);
lbl.CssClass = "menuItemGroupHeader";
lbl.Text = menu.GroupName;
this.Controls.Add(lbl);
>
HoverMenuExtender extender = new HoverMenuExtender();
extender.ID = string.Concat("ExtenderQ", menu.ID);
extender.TargetControlID = lbl.ID;
extender.PopupControlID = menu.ID;
extender.PopupPosition = HoverMenuPopupPosition.Bottom;
this.Controls.Add(extender);
}
>
>
The amazing thing is here, that the Label control and the
HoverMenuExtender AJAX Toolkit control both get added just fine, however I
added a watch on this.Controls.Count for the line where I add my
FloatingMenu control collection, "_menus", and after each call to
"this.Controls.Add(_menus[i]);" the Count is 0, however after I add the
label it's 1 and the extender it's 2.
>
I'm stumped.
>
Thanks,
Chad
>


_menus.Count is 2 before the loop. And the second, foreach loop adds 2
Labels and 2 HoverMenuExtenders as it should. I tried the first loop with a
foreach initially, but remembering SyncRoot issues and thought perhaps the
enumerator was breaking the Add operation, I changed it to the for loop to
no avail.

"IfThenElse" <sql_agentman@.hotmail.comwrote in message
news:%23D0oraEEIHA.6120@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

What is the value of _menus.Count before the for loop
>
>
"Chad Scharf" <chadscharf@.community.nospamwrote in message
news:%23qrSW5CEIHA.5752@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>Ok, as silly as it may sound, I have a situation where I am creating a
>CompositeControl in ASP.NET 2.0, C#. I have the following code in the
>CreateChildControls() method that build the control's child control
>collection:
>>
>for (int i = 0; i < _menus.Count; i++)
>this.Controls.Add(_menus[i]);
>>
>foreach (FloatingMenu menu in _menus)
>{
>Label lbl = new Label();
>lbl.ID = string.Concat("GroupQ", menu.ID);
>lbl.CssClass = "menuItemGroupHeader";
>lbl.Text = menu.GroupName;
>this.Controls.Add(lbl);
>>
>HoverMenuExtender extender = new HoverMenuExtender();
>extender.ID = string.Concat("ExtenderQ", menu.ID);
>extender.TargetControlID = lbl.ID;
>extender.PopupControlID = menu.ID;
>extender.PopupPosition = HoverMenuPopupPosition.Bottom;
>this.Controls.Add(extender);
>}
>>
>>
>The amazing thing is here, that the Label control and the
>HoverMenuExtender AJAX Toolkit control both get added just fine, however
>I added a watch on this.Controls.Count for the line where I add my
>FloatingMenu control collection, "_menus", and after each call to
>"this.Controls.Add(_menus[i]);" the Count is 0, however after I add the
>label it's 1 and the extender it's 2.
>>
>I'm stumped.
>>
>Thanks,
>Chad
>>


>
>


Does anyone have any clue why this would happen? I'm still banging my head
against a wall trying to figure this out.

"Chad Scharf" <chadscharf@.community.nospamwrote in message
news:%23qrSW5CEIHA.5752@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Ok, as silly as it may sound, I have a situation where I am creating a
CompositeControl in ASP.NET 2.0, C#. I have the following code in the
CreateChildControls() method that build the control's child control
collection:
>
for (int i = 0; i < _menus.Count; i++)
this.Controls.Add(_menus[i]);
>
foreach (FloatingMenu menu in _menus)
{
Label lbl = new Label();
lbl.ID = string.Concat("GroupQ", menu.ID);
lbl.CssClass = "menuItemGroupHeader";
lbl.Text = menu.GroupName;
this.Controls.Add(lbl);
>
HoverMenuExtender extender = new HoverMenuExtender();
extender.ID = string.Concat("ExtenderQ", menu.ID);
extender.TargetControlID = lbl.ID;
extender.PopupControlID = menu.ID;
extender.PopupPosition = HoverMenuPopupPosition.Bottom;
this.Controls.Add(extender);
}
>
>
The amazing thing is here, that the Label control and the
HoverMenuExtender AJAX Toolkit control both get added just fine, however I
added a watch on this.Controls.Count for the line where I add my
FloatingMenu control collection, "_menus", and after each call to
"this.Controls.Add(_menus[i]);" the Count is 0, however after I add the
label it's 1 and the extender it's 2.
>
I'm stumped.
>
Thanks,
Chad
>

Tuesday, March 13, 2012

thread safety

Hi,
I have a web app which has the following design to get to the DB
Web Page (uses)
-> .net DLL library
--> has a class with static methods
--> static method to-do basic DB operations like create a
DataReader for given sql, get Dataset etc
Big question is... Is this design safe when a lot of users are hitting the
web site from the asp.net threading perspective?As long as the static methods dont access static fields or properties then i
t
should be thread safe.
Ciaran O''Donnell
http://wannabedeveloper.space.live.com
"tjain" wrote:

> Hi,
> I have a web app which has the following design to get to the DB
> Web Page (uses)
> -> .net DLL library
> --> has a class with static methods
> --> static method to-do basic DB operations like create a
> DataReader for given sql, get Dataset etc
> Big question is... Is this design safe when a lot of users are hitting th
e
> web site from the asp.net threading perspective?
>

Thread Safety?

The following code hasbeen provided to me by a partner company for use in our asp.netapplication. Here is the class that I am questioning:

public class CurrentPageStyle
{
/// <summary>
/// The PageStyleRow for the current request.
/// </summary>
private static PageStylesDefinition.PageStyleRow currentpagestylerow;

/// <param name="ctxt">This gets the current pagestyle</param>
public CurrentPageStyle(HttpContext ctxt)
{
string keyword = ctxt.Request.QueryString["DView"];
if (keyword != null)
{
currentpagestylerow = TKConfiguration.Page_Styles_Definition.FindAll(keyword);
}
else
{
PageStylesDefinition.PageStylesRow toppsr = TKConfiguration.Page_Styles_Definition.GetFirst();
currentpagestylerow = TKConfiguration.Page_Styles_Definition.FindAll(toppsr.DefaultKeyword);
}
}

/// <summary>
/// This initializes the static member
/// </summary>
static CurrentPageStyle()
{
currentpagestylerow = null;
}

/// <summary>
/// Access to the current page style row for the request.
/// </summary>
public static PageStylesDefinition.PageStyleRow CurrentPageStyleRow
{
get
{
return currentpagestylerow;
}
set
{
currentpagestylerow = value;
}
}

Here is the usage from the global.asax file:

protected void Application_AcquireRequestState(object sender, EventArgs e)
{
CurrentPageStyle.CurrentPageStyleRow = null;
string[] pagestyle = Request.QueryString.GetValues('DView');
if (pagestyle != null)
{
if (pagestyle.Length != 0)
{
PageStylesDefinition.PageStyleRow psr = TKConfiguration.Page_Styles_Definition.FindAll(pagestyle[0]);
CurrentPageStyle.CurrentPageStyleRow = psr;
}
}

}

Myconcern is that the Application_AcquireRequestState event handler iscalled for every web request and it is setting a staticCurrentPageStyleRow which is then used later in the application. Myunderstanding is that there should only be one staticCurrentPageStyleRow per application and there can be web requests onmultiple threads so all of the threads will be sharing the sameCurrentPageStyleRow. Since there can be a differentCurrentPageStyleRow for each request, I think this is not thread safeand user 1 could end up getting user 2's CurrentPageStyleRow. I wantto make sure I am correct about this before reporting the issue to thepartner company. Am I right or am I off base?

Thanks,
Eric

In my modest opinion you should move that to an HttpModule to capture the request, and yes do not use an static class member! Why can't be an instance like the class?
Nice finding Eric! However some more people here may want to comment! Don't take my word for it

Al,

I am in the process of moving this to an HttpModule. As I said, the code was supplied by a partner company. I am in the process of adapting it to meet our needs. That was when I ran across this bit of code that does not appear to be thread safe. I am the only experienced .net developer on staff here, so I wanted someone else review the code and confirm my concerns before I reported it as a bug.

Thanks,
Eric

Thread was being aborted in Response.Redirect

I am logging the following error when re-directing via Response.Redirect:
"Thread was being aborted
at System.Threading.Thread.AbortInternal() at
System.Threading.Thread.Abort(Object stateInfo) at
System.Web.HttpResponse.End() at System.Web.HttpResponse.Redirect(String
url, Boolean endResponse) at ..."
It doesn't interfere with the functionality and is transparent, and the only
reason I know it is tripped is because I write the errors to a log.
I am doing some processing in my code-behind, and after processing simply
re-direct to the next page. Is there a proper way of ending things before
re-directing?
I have used the boolean parameter for ending the thread, but it seems to
have no effect.
Thanks,
gsk
http://www.meblogic.comthis is normal, Response.End() is implemented as a thread abort.
-- bruce (sqlwork.com)
"GSK" <gsk@.NiOcSaP.nAeMt> wrote in message
news:uAXMCCYTEHA.1168@.TK2MSFTNGP11.phx.gbl...
> I am logging the following error when re-directing via Response.Redirect:
> "Thread was being aborted
> at System.Threading.Thread.AbortInternal() at
> System.Threading.Thread.Abort(Object stateInfo) at
> System.Web.HttpResponse.End() at System.Web.HttpResponse.Redirect(String
> url, Boolean endResponse) at ..."
> It doesn't interfere with the functionality and is transparent, and the
only
> reason I know it is tripped is because I write the errors to a log.
> I am doing some processing in my code-behind, and after processing simply
> re-direct to the next page. Is there a proper way of ending things before
> re-directing?
> I have used the boolean parameter for ending the thread, but it seems to
> have no effect.
> Thanks,
> gsk
> http://www.meblogic.com
>
>