Saturday, March 31, 2012
Themes/skins with multiple browsers
We're developing an application that should render well on both IE and
Firefox and should be based on Themes. Does anyone have any good tips on how
to maintain different CSS-files for different browsers and still use themes?
How/where do you select the CSS to use as this is autogenerated?
Thanks,
MansoOn Wed, 29 Mar 2006 08:45:02 -0800, Manso wrote:
> Does anyone have any good tips on how to maintain different CSS-files
> for different browsers and still use themes?
Yes, don't do it. There is (almost) no reason to maintain different CSS
files for different browsers. The one real exception here is NN4, but
using the @.import hack is common practice.
Unless you have a very complex design, you can design a site with only
minimal hacks to work on multiple browsers. You should just stay away from
features that are problematic.
It's very difficult to accurately sniff which browser is which, and serve
the correct CSS. You can't rely on browser agent strings, because many
people have their non-IE browsers configured to report that they are IE.
Themes/skins with multiple browsers
We're developing an application that should render well on both IE and
Firefox and should be based on Themes. Does anyone have any good tips on how
to maintain different CSS-files for different browsers and still use themes?
How/where do you select the CSS to use as this is autogenerated?
Thanks,
MansoOn Wed, 29 Mar 2006 08:45:02 -0800, Manso wrote:
> Does anyone have any good tips on how to maintain different CSS-files
> for different browsers and still use themes?
Yes, don't do it. There is (almost) no reason to maintain different CSS
files for different browsers. The one real exception here is NN4, but
using the @.import hack is common practice.
Unless you have a very complex design, you can design a site with only
minimal hacks to work on multiple browsers. You should just stay away from
features that are problematic.
It's very difficult to accurately sniff which browser is which, and serve
the correct CSS. You can't rely on browser agent strings, because many
people have their non-IE browsers configured to report that they are IE.
Thems and Templets.
Hello to all,
I am learning to apply themes and css to web application.
I want to know are there any themes and temeplets awailable for download?
If you download the starter kits, or tutorial code, some of them employ themes and templates, you could use them as examples.
The link is here:
http://www.asp.net/default.aspx?tabindex=5&tabid=41
There has been an I/O Error: Error #2038 - The SaveAs method is configured to require a ro
The application is in NET 20 using vs.2005 and FLEX that was originally in C# which I converted to VB. This whole thing started because a client wanted upload progress indicator for file uploads. It seems to happen after the file is uploaded. How asp.net works is it will cache the file while uploading and then when the full file is uploaded it then seems to copy to the upload Directory. It is at this time that it tosses the error. In firefox it gives a bit more details.
Here is what happens. Select a file to upload, File uploads and on 100% the first error box appears:
There has been an I/O Error: Error #2038: File I/O Error. URL: http://faroutcomputers/Upload.axd?
Then you click okay and the second one shows up:
There has been an HTTP Error: status code 500
Oh and another interesting thing. If I upload with IE7 I get the two errors but the file uploads and is present in the upload directory. If I upload with firefox I get the same two errors but the file does not appear in the upload directory and isn't completed.
> I am running this application on Windows server 2003 enterprise.
> IIS 6
I found this entry in event viewer on windows 2003:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/13/2007 6:05:01 PM
Event time (UTC): 11/13/2007 11:05:01 PM
Event ID: 8161cd1f609b436382ae30ae036145bc
Event sequence: 128
Event occurrence: 9
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1148271820/Root/YoyoStudiosUploader2-3-128394676961048560
Trust level: Full
Application Virtual Path: /YoyoStudiosUploader2
Application Path: C:\CommercialWebsites\YoyoStudiosUploader2\
Machine name: WEBSLAVE2
Process information:
Process ID: 668
Process name: aspnet_wp.exe
Account name: WEBSLAVE2\ASPNET
Exception information:
Exception type: HttpException
Exception message: The SaveAs method is configured to require a rooted path, and the path 'Testing.avi' is not rooted.
Request information:
Request URL: http://faroutcomputers.dyndns.biz:8083/YoyoStudiosUploader2/Upload.axd
Request path: /YoyoStudiosUploader2/Upload.axd
User host address: 192.168.1.14
User:
Is authenticated: False
Authentication Type:
Thread account name: WEBSLAVE2\ASPNET
Thread information:
Thread ID: 1
Thread account name: WEBSLAVE2\ASPNET
Is impersonating: False
Stack trace: at System.Web.HttpPostedFile.SaveAs(String filename)
at Upload.ProcessRequest(HttpContext context) in C:\CommercialWebsites\YoyoStudiosUploader2\App_Code\Upload.vb:line 84
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Anyone know why this is happening?
Can you post some of the code where the error is occurring?
Hi,
Based on my understanding, when you use the FileUpload control to upload the file in your asp.net application, you get the error message above. If I have misunderstood you, please feel free to let me know.
Base on the exception message, the problem is that the HttpPostedFile.SaveAs method doesn't accept the file path that you passed.
To better understand your issue, could you please confirm the following information:
Please make sure that the path we pass is correct. We can insert the breakpoint to check.
Okay the application works FINE in IE.
Here is what happens with FIREFOX.
Select a file to upload, File uploads and on 100% the first error box appears:
There has been an I/O Error: Error #2038: File I/O Error. URL: http://faroutcomputers/Upload.axd?
Then you click okay and the second one shows up:
There has been an HTTP Error: status code 500
THIS ERROR IS SHOWN IN THE WINDOWS 2003 Event VIewer.
Exception information:
Exception type: HttpException
Exception message: The SaveAs method is configured to require a rooted path, and the path 'test.mp3' is not rooted.
Anyone know why I get an error in Firefox and IE works like a charm?
Session("FtpFolder") has a value of"C:\CommercialWebsites\mbelcher\"
and this is also shown in the trace info as being the vlaue of the session variable. IE works no issues but Firefox says no.... also Safari on a mac has the same errors as firefox.
CODE BELOW:
Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.IO
Public Class Upload
Implements IHttpHandler
Implements IRequiresSessionState
Public ReadOnly Property isReusable() As Boolean _
Implements IHttpHandler.IsReusable
Get
Return True
End Get
End Property
Public Sub Upload()
End Sub
Public Sub ProcessRequest(ByVal context As HttpContext) _
Implements IHttpHandler.ProcessRequest
If context.Request.Files.Count > 0 Then
' get the applications path
Dim tempFile As String = context.Request.PhysicalApplicationPath
Dim j As Int16
' get the current file
Dim uploadFile As HttpPostedFile = context.Request.Files(0)
' if there was a file uploded
If uploadFile.ContentLength > 0 Then
' save the file to the upload directory
Dim strDirectory As String = HttpContext.Current.Session("FtpFolder")
strDirectory = HttpContext.Current.Session("FtpFolder")
uploadFile.SaveAs(String.Format("{0}{1}", strDirectory, uploadFile.FileName))
' HttpPostedFile has an InputStream also. You can pass this to
' a function, or business logic. You can save it a database:
'byte[] fileData = new byte[uploadFile.ContentLength];
'uploadFile.InputStream.Write(fileData, 0, fileData.Length);
' save byte array into database.
' something I do is extract files from a zip file by passing
' the inputStream to a function that uses SharpZipLib found here:
'http://www.icsharpcode.net/OpenSource/SharpZipLib/
' and then save the files to disk.
End If
'Next
End If
' Used as a fix for a bug in mac flash player that makes the
' onComplete event not fire
HttpContext.Current.Response.Write(" ")
End Sub
End Class
Okay the application works FINE in IE.
Here is what happens with FIREFOX.
Select a file to upload, File uploads and on 100% the first error box appears:
There has been an I/O Error: Error #2038: File I/O Error. URL: http://faroutcomputers/Upload.axd?
Then you click okay and the second one shows up:
There has been an HTTP Error: status code 500
THIS ERROR IS SHOWN IN THE WINDOWS 2003 Event VIewer.
Exception information:
Exception type: HttpException
Exception message: The SaveAs method is configured to require a rooted path, and the path 'test.mp3' is not rooted.
Anyone know why I get an error in Firefox and IE works like a charm?
Session("FtpFolder") has a value of"C:\CommercialWebsites\mbelcher\"
and this is also shown in the trace info as being the vlaue of the session variable. IE works no issues but Firefox says no.... also Safari on a mac has the same errors as firefox.
CODE BELOW:
Imports Microsoft.VisualBasicImports SystemImports System.DataImports System.ConfigurationImports System.WebImports System.Web.SecurityImports System.Web.UIImports System.Web.UI.WebControlsImports System.Web.UI.WebControls.WebPartsImports System.Web.UI.HtmlControlsImports System.IOPublic Class UploadImplements IHttpHandlerImplements IRequiresSessionStatePublic ReadOnly Property isReusable()As Boolean _Implements IHttpHandler.IsReusableGet Return True End Get End Property Public Sub Upload()End Sub Public Sub ProcessRequest(ByVal contextAs HttpContext) _Implements IHttpHandler.ProcessRequestIf context.Request.Files.Count > 0Then' get the applications pathDim tempFileAs String = context.Request.PhysicalApplicationPathDim jAs Int16' get the current fileDim uploadFileAs HttpPostedFile = context.Request.Files(0)' if there was a file uplodedIf uploadFile.ContentLength > 0Then' save the file to the upload directoryDim strDirectoryAs String = HttpContext.Current.Session("FtpFolder") strDirectory = HttpContext.Current.Session("FtpFolder") uploadFile.SaveAs(String.Format("{0}{1}", strDirectory, uploadFile.FileName))' HttpPostedFile has an InputStream also. You can pass this to ' a function, or business logic. You can save it a database: 'byte[] fileData = new byte[uploadFile.ContentLength]; 'uploadFile.InputStream.Write(fileData, 0, fileData.Length); ' save byte array into database. ' something I do is extract files from a zip file by passing ' the inputStream to a function that uses SharpZipLib found here: ' http://www.icsharpcode.net/OpenSource/SharpZipLib/ ' and then save the files to disk.End If'NextEnd If' Used as a fix for a bug in mac flash player that makes the ' onComplete event not fire HttpContext.Current.Response.Write(" ")End SubEnd Class Hi,
Thanks for your response.
As far as I know, the FileUpload works differently in the IE and FireFox. For example, FileUpload1.PostedFile.FileName returns full path in the IE, but returns file name in the FireFox. So please check the uploadFile.FileName in the IE and FireFox. We can only get the file name with System.IO.Path.GetFileName method, such asSystem.IO.Path.GetFileName( FileUpload1.PostedFile.FileName );
I hope this helps.
So, in other words, your session variable is not set in Firefox. Is this
because you have disabled cookies in Firefox? Or are blocking them for that
site?
I checked and firefox was not blocking cookies but for some reason it wasn't getting the session information. I changed to cookeless and it works fine now in all browsers. There is another issue on a different server that I put the application on. Of course it works fine here on my development server but not on the published one. My server is a development server and is on a machine to itself and I do not work off of it. It hosts many websites all of which work fine viewed form here or out on the net.
Same exact Application, but different servers. Both are windows 2003 servers.
My site:http://faroutcomputers.dyndns.biz:8083/YoyoStudiosUploader2/ The application works fine here on all browsers and images are fine
Site with issues:http://upload.yoyostudios.com – Pictures missing very strange. Haven't seen this issue before.
There can be only one page directive.
I'm getting the "There can be only one 'page' directive."error message at an application that I just uploaded from my dev machine to a shared 'production' server. But here's the deal.
It goes to the login page just fine. Then it drops to default.aspx, presenting...nothing! It's supposed to "Response.Redirect("home.aspx")" But it doesn't. Then, if I point manually to home.aspx, I get:
Line 43: <%# DataBinder.Eval(Container, "DataItem.text")%>with weird spacing and all. And the line numbers are screwey anyway. None of this happened on my local dev machine.
Line 44: </a>
Line 45: <%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false" Codebehind="home.aspx.vb" Inherits="MAB.home" %>
Line 46: <%@dotnet.itags.org. Register TagPrefix="uc1" TagName="MAB" src="http://pics.10026.com/?src=MAB.ascx" %>
Line 47: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" />
Anyone recognize the symptoms? I'm guessing that it's all one problem.
Thanks for reading,
Chris
Have you simply opened the aspx page and inspect the contents?
Looks like you have some funky include code going on or the like
double check for a control ( .ascx) that has a page directive in it - did you make sure the server is running the same version framework your using ?
Problem might be with page directive of control ( .ascx) .
I was thinking the same stuff y'all were.
There is one user control, it doesn't have a page directive, just the "<%@. Control Language-..." directive. I agree that it looks like messed up include, but I'm not using any includes anywhere in the app.
The lines 43 and 44 shown in the error page are exactly what I'd predict. Then it looks like it lists lines 1-3 as 45-47.
I don't know if the server is running the same framework version. Hmm. I'll look into that if you think it's a viable issue. What do I do if they're different?
Chris
So my application was developed under framework v. 1.1.4322.0 and the web host I use says "We are currently running ASP.Net 1.1 framework." How 'off' would the versions have to be to cause these kinds of problems? Anyone else have any ideas?
Chris
asp v1.1 means 1.1.4322 - so you should be OK - there are only 3 I think 1.0, 1.1, and 2.0
post your home.aspx code - might give more clues
OK, how? When I cut and paste the code in it's altered into WYSIWYG mash. Is there a trick to it?
hmmm. try putting it between [ code] tags
[ code]
put code here
[ /code]
I had to add a space to the tag so it would show up !
so thats....... bracket code bracket with no spaces
: )
If this works, it was by opening it in notepad and copy-pasting out of that instead of out of VS.
<title>home</title><%@. Page Language="vb" AutoEventWireup="false" Codebehind="home.aspx.vb" Inherits="MAB.home" %>
<%@. Register TagPrefix="uc1" TagName="MAB" src="http://pics.10026.com/?src=MAB.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" />
<HTML>
<HEAD>
<title>home</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="http://links.10026.com/?link=Styles.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<uc1:MAB id="MAB1" runat="server" />
<div id="wrapper">
<div class="left">
<h3>Topics With Newest Entries</h3>
<div class="summary">
<asp:repeater id="rNew" runat="server">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
<ItemTemplate>
<li>
<span class="bold">
<a href="http://links.10026.com/?link=topic.aspx?sub=<%# DataBinder.Eval(Container, "DataItem.topic_ID") %>">
<%# DataBinder.Eval(Container, "DataItem.topic_name").toUpper %></a></span>
</li>
</ItemTemplate>
</asp:repeater>
</div>
<h3>Newest Picture Links</h3>
<div class="summary">
<asp:Repeater ID="rPics" Runat=server>
<ItemTemplate>
<a href="http://links.10026.com/?link=topic.aspx?sub=<%# DataBinder.Eval(Container, "DataItem.topic_ID")%>">
<%# DataBinder.Eval(Container, "DataItem.text")%>
</a>
</ItemTemplate>
</asp:Repeater>
</div>
</div
<div class="right">
<h2>Editor Highlights</h2>
<div class="summary">
<asp:repeater id="rEd" runat="server">
<ItemTemplate>
<span class="bold">
<a href="http://links.10026.com/?link=topic.aspx?sub=<%# DataBinder.Eval(Container, "DataItem.topic_ID") %>">
<%# DataBinder.Eval(Container, "DataItem.topic_name").toUpper %></a>
</span>by
<%# DataBinder.Eval(Container, "DataItem.member_name") %>,
</ItemTemplate>
</asp:repeater>
</div>
</div
<div class="right">
<h2>Highest Rated</h2>
<asp:repeater id="rHigh" runat="server">
<ItemTemplate>
<div class="summary" style="background-color: #ffd;">
<div class="headline">
<span class="bold">
<a href="http://links.10026.com/?link=topic.aspx?sub=<%# DataBinder.Eval(Container, "DataItem.topic_ID") %>">
<%# DataBinder.Eval(Container, "DataItem.topic_name").toUpper %></a>
</span>by
<%# DataBinder.Eval(Container, "DataItem.member_name") %>
on
<%# DataBinder.Eval(Container, "DataItem.creation_date").ToShortDateString %>
</div>
<%# DataBinder.Eval(Container, "DataItem.text") %>
</div>
</ItemTemplate>
</asp:repeater></div>
</div>
<asp:label id="lTest" Runat="server" Font-Size="Larger" Font-Bold="True" ForeColor="#400000" />
</form>
</body>
</HTML
well - for starters
<title>home</title><@.Page Language="vb" AutoEventWireup="false" Codebehind="home.aspx.vb"Inherits="MAB.home" >
needs to be switched around
the <@.Page directive has to be first line ( I believe) and title belongs in head tags
so make that like this
<@.Page Language="vb" AutoEventWireup="false" Codebehind="home.aspx.vb"Inherits="MAB.home" >
<head>
<title>home</title>
<meta...
other head stuff.....
</head
try that and see what happens
I'm becoming kind of freaked out about this. There is no <title>home</title> in my source before the page directive. If I paste from VS, it's trying to render the HTML. I'm trying it below to compare how it looks to the above suck.
<%@. Page Language="vb" AutoEventWireup="false" Codebehind="home.aspx.vb" Inherits="MAB.home" %> <%@. Register TagPrefix="uc1" TagName="MAB" src="http://pics.10026.com/?src=MAB.ascx" %>
<META content="Microsoft Visual Studio .NET 7.1" name=GENERATOR>
<META content="Visual Basic .NET 7.1" name=CODE_LANGUAGE>
<META content=JavaScript name=vs_defaultClientScript>
<META content=http://schemas.microsoft.com/intellisense/ie5 name=vs_targetSchema><LINK href="http://links.10026.com/?link=Styles.css" type=text/css rel=stylesheet>
<FORM id=Form1 method=post runat="server"><?xml:namespace prefix = uc1 /><uc1:MAB id=MAB1 runat="server"></uc1:MAB>
<DIV id=wrapper>
<DIV class=left>
<H3>Topics With Newest Entries</H3>
<DIV class=summary><?xml:namespace prefix = asp /><asp:repeater id=rNew runat="server"><HEADERTEMPLATE></HEADERTEMPLATE></asp:repeater>
<UL><FOOTERTEMPLATE></FOOTERTEMPLATE></UL><ITEMTEMPLATE>
<LI><SPAN class=bold><A href="http://links.10026.com/?link=http://forums.asp.net/topic.aspx?sub=%3C%#%20DataBinder.Eval%28Container,%20" %="" )="" dataitem.topic_id="">"> <%# DataBinder.Eval(Container, "DataItem.topic_name").toUpper %></A></SPAN> </ITEMTEMPLATE></LI></DIV>
<H3>Newest Picture Links</H3>
<DIV class=summary><asp:Repeater id=rPics runat="server"><ITEMTEMPLATE><A href="http://links.10026.com/?link=http://forums.asp.net/topic.aspx?sub=%3C%#%20DataBinder.Eval%28Container,%20" )="" dataitem.topic_id="">"> <%# DataBinder.Eval(Container, "DataItem.text")%> </A></ITEMTEMPLATE></asp:Repeater></DIV></DIV>
<DIV class=right>
<H2>Editor Highlights</H2>
<DIV class=summary><asp:repeater id=rEd runat="server"><ITEMTEMPLATE><SPAN class=bold><A href="http://links.10026.com/?link=http://forums.asp.net/topic.aspx?sub=%3C%#%20DataBinder.Eval%28Container,%20" %="" )="" dataitem.topic_id="">"> <%# DataBinder.Eval(Container, "DataItem.topic_name").toUpper %></A> </SPAN>by <%# DataBinder.Eval(Container, "DataItem.member_name") %>, </ITEMTEMPLATE></asp:repeater></DIV></DIV>
<DIV class=right>
<H2>Highest Rated</H2><asp:repeater id=rHigh runat="server"><ITEMTEMPLATE></ITEMTEMPLATE></asp:repeater>
<DIV class=summary style="BACKGROUND-COLOR: rgb(255,255,221)">
<DIV class=headline><SPAN class=bold><A href="http://links.10026.com/?link=http://forums.asp.net/topic.aspx?sub=%3C%#%20DataBinder.Eval%28Container,%20" %="" )="" dataitem.topic_id="">"> <%# DataBinder.Eval(Container, "DataItem.topic_name").toUpper %></A> </SPAN>by <%# DataBinder.Eval(Container, "DataItem.member_name") %> on <%# DataBinder.Eval(Container, "DataItem.creation_date").ToShortDateString %> </DIV><%# DataBinder.Eval(Container, "DataItem.text") %> </DIV></DIV></DIV><asp:label id=lTest runat="server" forecolor="#400000" font-bold="True" font-size="Larger"></asp:label></FORM><BR>
post the mab.ascx and the home.vb.aspx please - they should be plain text - if not - you can paste into notepad then copy-paste.
First, thanks for all your time. Now, these are pasted from VS. When I do that, it looks terrible in the post screen, but turns out almost OK. When I paste from notepad, every tab and space shows up as a etc. So:
--
mab.ascx:
--
<%@. Control Language="vb" AutoEventWireup="false" Codebehind="MAB.ascx.vb" Inherits="MAB.MAB" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
Welcome !
Add a Topic
Editor Queue
Admin Feedback
MAB Home
OrSearch
--
home.aspx.vb
--
Imports System.Data.SqlClient
Imports System.Text.RegularExpressions
Public Class home
Inherits System.Web.UI.Page
Public Conn As New SqlConnection(ConfigurationSettings.AppSettings("conString"))
Protected WithEvents cMAB As MAB
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents rNew As System.Web.UI.WebControls.Repeater
Protected WithEvents rPics As System.Web.UI.WebControls.Repeater
Protected WithEvents rEd As System.Web.UI.WebControls.Repeater
Protected WithEvents rHigh As System.Web.UI.WebControls.Repeater
Protected WithEvents lTest As System.Web.UI.WebControls.Label
Protected WithEvents ddTopic As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents newtopic As System.Web.UI.WebControls.HyperLink
Protected WithEvents hEditorQueue As System.Web.UI.WebControls.HyperLink
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Const homeSize As Integer = 8 'number of articles per column here
Const homeLength As Integer = 200 'number of characters to display per article
Dim qs As String = "SELECT top 10 MAB_articles.article_ID, (SELECT top 1 MAB_articleIndex.topic_ID FROM MAB_articleIndex WHERE "
qs &= "MAB_articleIndex.article_ID = MAB_articles.article_ID) as topic_ID, ( SELECT top 1 topic_name FROM MAB_topics, MAB_articleIndex "
qs &= "WHERE MAB_topics.topic_ID = MAB_articleIndex.topic_ID AND MAB_articleIndex.article_ID = MAB_articles.article_ID) as topic_name "
qs &= "INTO T FROM MAB_articles ORDER BY MAB_articles.mod_date SELECT distinct topic_ID, topic_name FROM T drop table T"
Dim daNew As New SqlDataAdapter(qs, Conn)
Dim dsNew As New DataSet
Conn.Open()
daNew.Fill(dsNew, "articles")
Conn.Close()
rNew.DataSource = dsNew.Tables("articles")
rNew.DataBind()
qs = "SELECT text, (SELECT TOP 1 MAB_topics.topic_ID FROM MAB_topics, MAB_articleIndex WHERE MAB_articles.article_ID = "
qs &= "MAB_articleIndex.article_ID AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID ORDER BY MAB_articleIndex.topic_ID ASC) "
qs &= " as topic_ID FROM MAB_articles WHERE CONTAINS(text, '""img src=*""')"
Dim daPics As New SqlDataAdapter(qs, Conn)
Dim dsPics As New DataSet
Conn.Open()
daPics.Fill(dsPics, "images")
Conn.Close()
For i As Integer = 0 To dsPics.Tables(0).Rows.Count - 1
'regex match for images and extract image tags into the "text" column of the dataset
Dim pat As String = "<img src=.+?>"
Dim r As Regex = New Regex(pat, RegexOptions.IgnoreCase Or RegexOptions.Multiline)
Dim m As Match = r.Match(dsPics.Tables(0).Rows(i).Item("text"))
'Dim matchcount As Integer = 0
Dim newImageString As String = ""
While (m.Success)
'matchcount += 1
newImageString &= m.Value
m = m.NextMatch
End While
dsPics.Tables(0).Rows(i).Item("text") = newImageString
Next
rPics.DataSource = dsPics.Tables(0)
rPics.DataBind()
qs = "SELECT distinct top 20 (MAB_articles.rating * MAB_articles.ed_pick) as ranking, (SELECT TOP 1 MAB_topics.topic_ID FROM MAB_topics, MAB_articleIndex WHERE MAB_articles.article_ID = MAB_articleIndex.article_ID AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID ORDER BY MAB_articleIndex.topic_ID ASC) as topic_ID, (SELECT TOP 1 MAB_topics.topic_name FROM MAB_topics, MAB_articleIndex WHERE MAB_articles.article_ID = MAB_articleIndex.article_ID AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID ORDER BY MAB_articleIndex.topic_ID ASC) as topic_name, MAB_articles.creation_date, MAB_members.member_name, substring(MAB_articles.text, 1, 200) as text FROM MAB_articles, MAB_topics, MAB_articleIndex, MAB_members WHERE MAB_articles.article_ID = MAB_articleIndex.article_ID AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID AND MAB_members.member_ID = MAB_articles.author_ID AND MAB_articles.ed_pick > 0 ORDER BY ranking DESC"
Dim daEd As New SqlDataAdapter(qs, Conn)
Dim dsEd As New DataSet
Conn.Open()
daEd.Fill(dsEd, "articles")
Conn.Close()
For i As Integer = 0 To dsEd.Tables(0).Rows.Count - 1
dsEd.Tables("articles").Rows(i).Item(4) = deSpan(dsEd.Tables("articles").Rows(i).Item(4))
Next
rEd.DataSource = dsEd.Tables("articles")
rEd.DataBind()
qs = "SELECT distinct top 8 MAB_articles.rating, (SELECT TOP 1 MAB_topics.topic_ID FROM MAB_topics, MAB_articleIndex WHERE MAB_articles.article_ID = MAB_articleIndex.article_ID AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID ORDER BY MAB_articleIndex.topic_ID ASC) as topic_ID, (SELECT TOP 1 MAB_topics.topic_name FROM MAB_topics, MAB_articleIndex WHERE MAB_articles.article_ID = MAB_articleIndex.article_ID AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID ORDER BY MAB_articleIndex.topic_ID ASC) as topic_name, MAB_articles.creation_date, MAB_members.member_name, substring(MAB_articles.text, 1, 200) as text FROM MAB_articles, MAB_topics, MAB_articleIndex, MAB_members WHERE MAB_articles.article_ID = MAB_articleIndex.article_ID AND MAB_topics.topic_ID = MAB_articleIndex.topic_ID AND MAB_members.member_ID = MAB_articles.author_ID ORDER BY MAB_articles.rating DESC"
Dim daHigh As New SqlDataAdapter(qs, Conn)
Dim dsHigh As New DataSet
Conn.Open()
daHigh.Fill(dsHigh, "articles")
Conn.Close()
For i As Integer = 0 To dsHigh.Tables(0).Rows.Count - 1
dsHigh.Tables("articles").Rows(i).Item(4) = deSpan(dsHigh.Tables("articles").Rows(i).Item(4))
Next
rHigh.DataSource = dsHigh.Tables("articles")
rHigh.DataBind()
End Sub
Public Function deSpan(ByVal str As String) As String
Dim letterPlace As Integer = 0
Dim spanCount As Integer = 0
While letterPlace < str.Length - 6
If str.Substring(letterPlace, 6) = "<span " Then
spanCount += 1
ElseIf str.Substring(letterPlace, 6) = "</span" Then
spanCount -= 1
End If
letterPlace += 1
End While
Dim braceCount As Integer = 0
For j As Integer = 0 To str.Length - 1
If str.Chars(j) = "<" Then
braceCount += 1
ElseIf str.Chars(j) = ">" Then
braceCount -= 1
End If
Next
For k As Integer = 1 To braceCount
str &= ">"
Next
For i As Integer = 1 To spanCount
str &= "</span>"
Next
Return str
End Function
Private Sub cMAB_topicChanged(ByVal sender As Object, ByVal e As EventArgs) Handles cMAB.topicChanged
Response.Redirect("topic.aspx?sub=3")
End Sub
End Class
Chris (fingers crossed on how it turns out)
Well - I don't see anything wrong there...
You said in your first post that the default.aspx works ( which we haven't seen )
It takes you to login.aspx. From login.aspx, the user is supposed to be redirected to home.aspx
This is where it's failing right ? -Then if you manually type in home.aspx, you get the error.
can you post login aspx and it's vb code?
very weird since it works on development - I would assume its a path or security issue on production server
There is already an open DataReader associated with this Connection which must be clo
users hit the same database/page on an ASP.NET application using ADO.NET,
talking to a SQL 7 server. The error is perfectly repeatable :-( But this
should help!
The error is occurring inside ExecuteReader which uses a DataReader
internally.
Here are some things that I'm pretty sure it's *NOT*:
It's not because our data readers are not being closed - they are. If they
weren't being closed, then the same error would occur in single user
operation. It doesn't - it's only when two users (threads) are running at
once.
It's not connection pooling as we've turned that off using Pooling=False in
the SqlConnection connection string. I've verified it really is off by
watching connections open & close manually in SQL Enterprise manager.
The two threads are not (AFAIK) sharing the same connection object. The
SqlConnection object is not in a shared or static variable - it's stored as
a private variable within one of our classes (called MSSQL) in a variable
called m_Connection. This m_Connection variable is created each time we open
a connection using m_Connection = New SqlConnection(ConnString), opened,
used (ExecuteScalar) closed and then destroyed using m_Connection = nothing.
The instance of MSSQL is stored in the session cache but I've verified that
the two users/threads are indeed using their own instance of MSSQL and
therefore their own instance of m_Connection. The two instances of
m_Connection will have the same connection string (SQL login used, not
Windows authentication).
There are no exceptions/error conditions occuring elsewhere apart from this
final error.
I don't think it's the connection/data reader closing - I've triple checked
all open/close pairs and the close is always within a Try...Catch with the
connection closed in the Finally section.
The error never occurs in our own use of data readers, only from within
ExecuteScalar. Hmm, I guess I could write my own version of ExecuteScaler...
So, pretty flummoxed at the moment. I willing to try any suggestions!
Cheers, Rob.Does it happen in EVERY circumstance? It just sounds like your connected
access is being hit twice simultaneously.
"Rob Nicholson" <informed@.community.nospam> wrote in message
news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
> I'm starting to worry a bit now. We're getting the above error when two
> users hit the same database/page on an ASP.NET application using ADO.NET,
> talking to a SQL 7 server. The error is perfectly repeatable :-( But this
> should help!
> The error is occurring inside ExecuteReader which uses a DataReader
> internally.
> Here are some things that I'm pretty sure it's *NOT*:
> It's not because our data readers are not being closed - they are. If they
> weren't being closed, then the same error would occur in single user
> operation. It doesn't - it's only when two users (threads) are running at
> once.
> It's not connection pooling as we've turned that off using Pooling=False
> in
> the SqlConnection connection string. I've verified it really is off by
> watching connections open & close manually in SQL Enterprise manager.
> The two threads are not (AFAIK) sharing the same connection object. The
> SqlConnection object is not in a shared or static variable - it's stored
> as
> a private variable within one of our classes (called MSSQL) in a variable
> called m_Connection. This m_Connection variable is created each time we
> open
> a connection using m_Connection = New SqlConnection(ConnString), opened,
> used (ExecuteScalar) closed and then destroyed using m_Connection =
> nothing.
> The instance of MSSQL is stored in the session cache but I've verified
> that
> the two users/threads are indeed using their own instance of MSSQL and
> therefore their own instance of m_Connection. The two instances of
> m_Connection will have the same connection string (SQL login used, not
> Windows authentication).
> There are no exceptions/error conditions occuring elsewhere apart from
> this
> final error.
> I don't think it's the connection/data reader closing - I've triple
> checked
> all open/close pairs and the close is always within a Try...Catch with the
> connection closed in the Finally section.
> The error never occurs in our own use of data readers, only from within
> ExecuteScalar. Hmm, I guess I could write my own version of
> ExecuteScaler...
> So, pretty flummoxed at the moment. I willing to try any suggestions!
> Cheers, Rob.
>
Are any of the objects involved being stored in Application variables?
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Rob Nicholson" <informed@.community.nospam> wrote in message
news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
> I'm starting to worry a bit now. We're getting the above error when two
> users hit the same database/page on an ASP.NET application using ADO.NET,
> talking to a SQL 7 server. The error is perfectly repeatable :-( But this
> should help!
> The error is occurring inside ExecuteReader which uses a DataReader
> internally.
> Here are some things that I'm pretty sure it's *NOT*:
> It's not because our data readers are not being closed - they are. If they
> weren't being closed, then the same error would occur in single user
> operation. It doesn't - it's only when two users (threads) are running at
> once.
> It's not connection pooling as we've turned that off using Pooling=False
> in
> the SqlConnection connection string. I've verified it really is off by
> watching connections open & close manually in SQL Enterprise manager.
> The two threads are not (AFAIK) sharing the same connection object. The
> SqlConnection object is not in a shared or static variable - it's stored
> as
> a private variable within one of our classes (called MSSQL) in a variable
> called m_Connection. This m_Connection variable is created each time we
> open
> a connection using m_Connection = New SqlConnection(ConnString), opened,
> used (ExecuteScalar) closed and then destroyed using m_Connection =
> nothing.
> The instance of MSSQL is stored in the session cache but I've verified
> that
> the two users/threads are indeed using their own instance of MSSQL and
> therefore their own instance of m_Connection. The two instances of
> m_Connection will have the same connection string (SQL login used, not
> Windows authentication).
> There are no exceptions/error conditions occuring elsewhere apart from
> this
> final error.
> I don't think it's the connection/data reader closing - I've triple
> checked
> all open/close pairs and the close is always within a Try...Catch with the
> connection closed in the Finally section.
> The error never occurs in our own use of data readers, only from within
> ExecuteScalar. Hmm, I guess I could write my own version of
> ExecuteScaler...
> So, pretty flummoxed at the moment. I willing to try any suggestions!
> Cheers, Rob.
>
sql connections (until yukon), only support one request at a time. ther
error mens a second request was made on the connection without the previous
request reading all the result sets.
ExecuteScaler only reads the first row of the first result set, it does not
clear the results, you still need to close the underlying connection.
also be sure your command objects are not shared - you will get the same
results.
if you are getting this with pooling on, then you are definitely sharing the
data between thread in your code.
note: be sure you are not using fields in a vb module, as these are shared
across threads even if private. public/private just controls varible
accessibilty not sharing.
Public Module Test
private myData as myObj = new myObj ' shared across threads
End Module
-- bruce (sqlwork.com)
"Rob Nicholson" <informed@.community.nospam> wrote in message
news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
> I'm starting to worry a bit now. We're getting the above error when two
> users hit the same database/page on an ASP.NET application using ADO.NET,
> talking to a SQL 7 server. The error is perfectly repeatable :-( But this
> should help!
> The error is occurring inside ExecuteReader which uses a DataReader
> internally.
> Here are some things that I'm pretty sure it's *NOT*:
> It's not because our data readers are not being closed - they are. If they
> weren't being closed, then the same error would occur in single user
> operation. It doesn't - it's only when two users (threads) are running at
> once.
> It's not connection pooling as we've turned that off using Pooling=False
> in
> the SqlConnection connection string. I've verified it really is off by
> watching connections open & close manually in SQL Enterprise manager.
> The two threads are not (AFAIK) sharing the same connection object. The
> SqlConnection object is not in a shared or static variable - it's stored
> as
> a private variable within one of our classes (called MSSQL) in a variable
> called m_Connection. This m_Connection variable is created each time we
> open
> a connection using m_Connection = New SqlConnection(ConnString), opened,
> used (ExecuteScalar) closed and then destroyed using m_Connection =
> nothing.
> The instance of MSSQL is stored in the session cache but I've verified
> that
> the two users/threads are indeed using their own instance of MSSQL and
> therefore their own instance of m_Connection. The two instances of
> m_Connection will have the same connection string (SQL login used, not
> Windows authentication).
> There are no exceptions/error conditions occuring elsewhere apart from
> this
> final error.
> I don't think it's the connection/data reader closing - I've triple
> checked
> all open/close pairs and the close is always within a Try...Catch with the
> connection closed in the Finally section.
> The error never occurs in our own use of data readers, only from within
> ExecuteScalar. Hmm, I guess I could write my own version of
> ExecuteScaler...
> So, pretty flummoxed at the moment. I willing to try any suggestions!
> Cheers, Rob.
>
Bruce is on to something here. If you don't close the DataReader (even with
an ExecuteScalar), the pending rowset will not be flushed until you do (or
close the connection). This can take some time if the query returns a large
rowset or multiple resultsets. If you try to reuse the DataReader before
this is done, you'll get this exception.
hth
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
www.sqlreportingservices.net
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:u1SomHHwFHA.2232@.TK2MSFTNGP11.phx.gbl...
> sql connections (until yukon), only support one request at a time. ther
> error mens a second request was made on the connection without the
> previous request reading all the result sets.
> ExecuteScaler only reads the first row of the first result set, it does
> not clear the results, you still need to close the underlying connection.
> also be sure your command objects are not shared - you will get the same
> results.
> if you are getting this with pooling on, then you are definitely sharing
> the data between thread in your code.
> note: be sure you are not using fields in a vb module, as these are shared
> across threads even if private. public/private just controls varible
> accessibilty not sharing.
> Public Module Test
> private myData as myObj = new myObj ' shared across threads
> End Module
> -- bruce (sqlwork.com)
>
> "Rob Nicholson" <informed@.community.nospam> wrote in message
> news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
>
> Does it happen in EVERY circumstance? It just sounds like your connected
> access is being hit twice simultaneously.
Yes, pretty much. When the two users hit the "Go" button, it always fails at
the same line.
Cheers, Rob.
> Are any of the objects involved being stored in Application variables?
No, session used throughout.
Cheers, Rob.
> sql connections (until yukon), only support one request at a time. ther
> error mens a second request was made on the connection without the
previous
> request reading all the result sets.
Hi Bruce,
Just to clarify this, this means one "SqlConnection" object can only handle
one request at once. I'm aware of this issue hence the reason I said I'm
pretty sure we're closing the data reader and connections each time (I've
countred the opens and closes).
> ExecuteScaler only reads the first row of the first result set, it does
not
> clear the results, you still need to close the underlying connection.
Yes, we do that.
> also be sure your command objects are not shared - you will get the same
> results.
Yup, not shared - created each time within a non-shared class/object.
> if you are getting this with pooling on, then you are definitely sharing
the
> data between thread in your code.
Nope, occurs with pooling turned off.
> note: be sure you are not using fields in a vb module, as these are shared
> across threads even if private. public/private just controls varible
> accessibilty not sharing.
Not sure what you mean by fields?
> Public Module Test
> private myData as myObj = new myObj ' shared across threads
> End Module
Nope, nothing like this anyway. The only thing we do have is code like this:
Readonly Property SomePointer As SomeObject
Get
Static CachedSomePointer As SomeObject
If CachedSomePointer Is Nothing Then
CachedSomePointer = GetThePointerFromSomwhere()
End If
Return CachedSomePointer
End Get
End Property
Cheers, Rob.
> Bruce is on to something here. If you don't close the DataReader (even
with
> an ExecuteScalar), the pending rowset will not be flushed until you do (or
We do close the data reader I'm pretty sure. The basic problem is I think
the datareader is being closed. If it wasn't then the error would occur when
a single user tried the operation. Therefore, it looks like *somehow* the
two threads are sharing each other's connections. But I'm 99% sure they are
not sharing the same connection object.
Cheers, Rob.
> Does it happen in EVERY circumstance? It just sounds like your connected
> access is being hit twice simultaneously.
I realised that I can set-up a test environment that should repeat this by
simply a loop into a page_load that simply executes 10,000 ExecuteScaler
statements:
For i As Integer = 1 To 10000
Dim NumPeople As Integer =
CIMS_App.DataServer.ExecuteScaler(SQL)
Next
The SQL being executed is Select Count(*) From People. The source for
ExecuteScaler, OpenConnnection and CloseConnection are included below. No
parameters are being passed in this example so that bit can be ignored.
Now this is where something strange happened. I ran the above code from
within VS 2003 and it crashes with "SQL Server does not exist or access
denied" error. I think I need to work out why this is happening first! Okay,
so firing off 10,000 open connections, select and close connection isn't
something that would normally happen but it shouldn't crash...
Later... if the loop is changed to this:
CIMS_App.DataServer.OpenConnection()
For i As Integer = 1 To 10000
Dim NumPeople As Integer =
CIMS_App.DataServer.ExecuteScaler(SQL)
Next
CIMS_App.DataServer.CloseConnection()
The error doesn't occur. It's the rapid opening and closing of the
connection that's crashing - SQL 7 box BTW.
Cheers, Rob.
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
System.Data.SqlClient.SqlInternalConnection..ctor(SqlConnection
connection, SqlConnectionString connectionOptions)
System.Data.SqlClient.SqlConnection.Open()
Granite.MSSQL.OpenConnection() in
C:\Projects\CIMS_Dev\Granite\Databases\M
SSQL.vb:379
[GException: Unable to open connection to INFORMED02]
Granite.MSSQL.OpenConnection() in
C:\Projects\CIMS_Dev\Granite\Databases\M
SSQL.vb:381
Granite.MSSQL.ExecuteScaler(String SQL, SQL_Parameter[] Parameters) in
C:\Projects\CIMS_Dev\Granite\Databases\M
SSQL.vb:501
[GException: Unable to load data from INFORMED02 server.]
Granite.MSSQL.ThrowOpenException(Exception ex, String SQL) in
C:\Projects\CIMS_Dev\Granite\Databases\M
SSQL.vb:451
Granite.MSSQL.ExecuteScaler(String SQL, SQL_Parameter[] Parameters) in
C:\Projects\CIMS_Dev\Granite\Databases\M
SSQL.vb:533
CIMS.DefaultPage.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\CIMS_Dev\Default.aspx.vb:78
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
Here's the code:
Public Overrides Function ExecuteScaler(ByVal SQL As String, ByVal
ParamArray Parameters() As SQL_Parameter) As Object
' Trap the database operation.
Dim AlreadyOpen As Boolean
Try
' Open the connection.
AlreadyOpen = OpenConnection()
' Create SQL command.
Dim SQL_Command As New SqlCommand(SQL, m_Connection)
' Add SQL parameters.
For Each SQL_Parameter As SQL_Parameter In Parameters
Dim p As SqlParameter
Dim Value As Object = SQL_Parameter.Value
If Value.GetType Is GetType(System.Byte()) Then
Dim Data() As Byte = Value
p = New SqlParameter(SQL_Parameter.Name,
SqlDbType.Image, Data.Length, ParameterDirection.Input, False, 0, 0,
Nothing, DataRowVersion.Current, Data)
Else
Throw New Exception("MSSQL.ExecuteScalar can't handle "
& Value.GetType.FullName & " data types!")
End If
SQL_Command.Parameters.Add(p)
Next
' Add transaction if enabled.
If Not m_Trans Is Nothing Then
SQL_Command.Transaction = m_Trans
End If
' Execute the command.
ExecuteScaler = SQL_Command.ExecuteScalar
Catch ex As Exception
ThrowOpenException(ex, SQL)
Finally
' Close the connection.
If Not AlreadyOpen Then
CloseConnection()
End If
End Try
End Function
Public Overrides Function OpenConnection() As Boolean
If m_Connection Is Nothing Then
m_Connection = New SqlConnection(ConnectionString)
End If
If m_Connection.State = ConnectionState.Closed Then
Try
m_Connection.Open()
Catch ex As Exception
Throw New GException("Unable to open connection to " &
m_DataLink.ServerName, GraniteErrors.Error0016, ex)
End Try
Else
OpenConnection = True
End If
End Function
Public Overrides Sub CloseConnection()
If Not m_Connection Is Nothing Then
m_Connection.Close()
m_Connection = Nothing
End If
End Sub
There is already an open DataReader associated with this Connection
In the application, if I execute a long running query (which may time
out or something I guess) from one browser window, and in another
instance of the same web application in another browser window,
execute a very quick query, I get the above error message.
I have noted the fix at:
http://support.microsoft.com/defaul...b;en-us;Q319345
But I already have Service Pack 2 installed. Please help!
Thanks in Advance
Jamesbug in your code.
you probably have a connection defined a static variable (shared or public
in a module in vb.net). this would lead to the same connection being used by
all page requests (even concurrent), and as a connection only supports one
active query at a time, you get this error.
-- bruce (sqlwork.com)
"James Brown" <jbrown_gtfc@.hotmail.com> wrote in message
news:7a947814.0306260125.6425510a@.posting.google.c om...
> I have an ASP .NET application. [VS 2002, .NET Framework 1.0 SP2]
> In the application, if I execute a long running query (which may time
> out or something I guess) from one browser window, and in another
> instance of the same web application in another browser window,
> execute a very quick query, I get the above error message.
> I have noted the fix at:
> http://support.microsoft.com/defaul...b;en-us;Q319345
> But I already have Service Pack 2 installed. Please help!
> Thanks in Advance
> James
There is already an open DataReader associated with this Connection which must be closed f
users hit the same database/page on an ASP.NET application using ADO.NET,
talking to a SQL 7 server. The error is perfectly repeatable :-( But this
should help!
The error is occurring inside ExecuteReader which uses a DataReader
internally.
Here are some things that I'm pretty sure it's *NOT*:
It's not because our data readers are not being closed - they are. If they
weren't being closed, then the same error would occur in single user
operation. It doesn't - it's only when two users (threads) are running at
once.
It's not connection pooling as we've turned that off using Pooling=False in
the SqlConnection connection string. I've verified it really is off by
watching connections open & close manually in SQL Enterprise manager.
The two threads are not (AFAIK) sharing the same connection object. The
SqlConnection object is not in a shared or static variable - it's stored as
a private variable within one of our classes (called MSSQL) in a variable
called m_Connection. This m_Connection variable is created each time we open
a connection using m_Connection = New SqlConnection(ConnString), opened,
used (ExecuteScalar) closed and then destroyed using m_Connection = nothing.
The instance of MSSQL is stored in the session cache but I've verified that
the two users/threads are indeed using their own instance of MSSQL and
therefore their own instance of m_Connection. The two instances of
m_Connection will have the same connection string (SQL login used, not
Windows authentication).
There are no exceptions/error conditions occuring elsewhere apart from this
final error.
I don't think it's the connection/data reader closing - I've triple checked
all open/close pairs and the close is always within a Try...Catch with the
connection closed in the Finally section.
The error never occurs in our own use of data readers, only from within
ExecuteScalar. Hmm, I guess I could write my own version of ExecuteScaler...
So, pretty flummoxed at the moment. I willing to try any suggestions!
Cheers, Rob.Does it happen in EVERY circumstance? It just sounds like your connected
access is being hit twice simultaneously.
"Rob Nicholson" <informed@.community.nospam> wrote in message
news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
> I'm starting to worry a bit now. We're getting the above error when two
> users hit the same database/page on an ASP.NET application using ADO.NET,
> talking to a SQL 7 server. The error is perfectly repeatable :-( But this
> should help!
> The error is occurring inside ExecuteReader which uses a DataReader
> internally.
> Here are some things that I'm pretty sure it's *NOT*:
> It's not because our data readers are not being closed - they are. If they
> weren't being closed, then the same error would occur in single user
> operation. It doesn't - it's only when two users (threads) are running at
> once.
> It's not connection pooling as we've turned that off using Pooling=False
> in
> the SqlConnection connection string. I've verified it really is off by
> watching connections open & close manually in SQL Enterprise manager.
> The two threads are not (AFAIK) sharing the same connection object. The
> SqlConnection object is not in a shared or static variable - it's stored
> as
> a private variable within one of our classes (called MSSQL) in a variable
> called m_Connection. This m_Connection variable is created each time we
> open
> a connection using m_Connection = New SqlConnection(ConnString), opened,
> used (ExecuteScalar) closed and then destroyed using m_Connection =
> nothing.
> The instance of MSSQL is stored in the session cache but I've verified
> that
> the two users/threads are indeed using their own instance of MSSQL and
> therefore their own instance of m_Connection. The two instances of
> m_Connection will have the same connection string (SQL login used, not
> Windows authentication).
> There are no exceptions/error conditions occuring elsewhere apart from
> this
> final error.
> I don't think it's the connection/data reader closing - I've triple
> checked
> all open/close pairs and the close is always within a Try...Catch with the
> connection closed in the Finally section.
> The error never occurs in our own use of data readers, only from within
> ExecuteScalar. Hmm, I guess I could write my own version of
> ExecuteScaler...
> So, pretty flummoxed at the moment. I willing to try any suggestions!
> Cheers, Rob.
Are any of the objects involved being stored in Application variables?
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Rob Nicholson" <informed@.community.nospam> wrote in message
news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
> I'm starting to worry a bit now. We're getting the above error when two
> users hit the same database/page on an ASP.NET application using ADO.NET,
> talking to a SQL 7 server. The error is perfectly repeatable :-( But this
> should help!
> The error is occurring inside ExecuteReader which uses a DataReader
> internally.
> Here are some things that I'm pretty sure it's *NOT*:
> It's not because our data readers are not being closed - they are. If they
> weren't being closed, then the same error would occur in single user
> operation. It doesn't - it's only when two users (threads) are running at
> once.
> It's not connection pooling as we've turned that off using Pooling=False
> in
> the SqlConnection connection string. I've verified it really is off by
> watching connections open & close manually in SQL Enterprise manager.
> The two threads are not (AFAIK) sharing the same connection object. The
> SqlConnection object is not in a shared or static variable - it's stored
> as
> a private variable within one of our classes (called MSSQL) in a variable
> called m_Connection. This m_Connection variable is created each time we
> open
> a connection using m_Connection = New SqlConnection(ConnString), opened,
> used (ExecuteScalar) closed and then destroyed using m_Connection =
> nothing.
> The instance of MSSQL is stored in the session cache but I've verified
> that
> the two users/threads are indeed using their own instance of MSSQL and
> therefore their own instance of m_Connection. The two instances of
> m_Connection will have the same connection string (SQL login used, not
> Windows authentication).
> There are no exceptions/error conditions occuring elsewhere apart from
> this
> final error.
> I don't think it's the connection/data reader closing - I've triple
> checked
> all open/close pairs and the close is always within a Try...Catch with the
> connection closed in the Finally section.
> The error never occurs in our own use of data readers, only from within
> ExecuteScalar. Hmm, I guess I could write my own version of
> ExecuteScaler...
> So, pretty flummoxed at the moment. I willing to try any suggestions!
> Cheers, Rob.
sql connections (until yukon), only support one request at a time. ther
error mens a second request was made on the connection without the previous
request reading all the result sets.
ExecuteScaler only reads the first row of the first result set, it does not
clear the results, you still need to close the underlying connection.
also be sure your command objects are not shared - you will get the same
results.
if you are getting this with pooling on, then you are definitely sharing the
data between thread in your code.
note: be sure you are not using fields in a vb module, as these are shared
across threads even if private. public/private just controls varible
accessibilty not sharing.
Public Module Test
private myData as myObj = new myObj ' shared across threads
End Module
-- bruce (sqlwork.com)
"Rob Nicholson" <informed@.community.nospam> wrote in message
news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
> I'm starting to worry a bit now. We're getting the above error when two
> users hit the same database/page on an ASP.NET application using ADO.NET,
> talking to a SQL 7 server. The error is perfectly repeatable :-( But this
> should help!
> The error is occurring inside ExecuteReader which uses a DataReader
> internally.
> Here are some things that I'm pretty sure it's *NOT*:
> It's not because our data readers are not being closed - they are. If they
> weren't being closed, then the same error would occur in single user
> operation. It doesn't - it's only when two users (threads) are running at
> once.
> It's not connection pooling as we've turned that off using Pooling=False
> in
> the SqlConnection connection string. I've verified it really is off by
> watching connections open & close manually in SQL Enterprise manager.
> The two threads are not (AFAIK) sharing the same connection object. The
> SqlConnection object is not in a shared or static variable - it's stored
> as
> a private variable within one of our classes (called MSSQL) in a variable
> called m_Connection. This m_Connection variable is created each time we
> open
> a connection using m_Connection = New SqlConnection(ConnString), opened,
> used (ExecuteScalar) closed and then destroyed using m_Connection =
> nothing.
> The instance of MSSQL is stored in the session cache but I've verified
> that
> the two users/threads are indeed using their own instance of MSSQL and
> therefore their own instance of m_Connection. The two instances of
> m_Connection will have the same connection string (SQL login used, not
> Windows authentication).
> There are no exceptions/error conditions occuring elsewhere apart from
> this
> final error.
> I don't think it's the connection/data reader closing - I've triple
> checked
> all open/close pairs and the close is always within a Try...Catch with the
> connection closed in the Finally section.
> The error never occurs in our own use of data readers, only from within
> ExecuteScalar. Hmm, I guess I could write my own version of
> ExecuteScaler...
> So, pretty flummoxed at the moment. I willing to try any suggestions!
> Cheers, Rob.
Bruce is on to something here. If you don't close the DataReader (even with
an ExecuteScalar), the pending rowset will not be flushed until you do (or
close the connection). This can take some time if the query returns a large
rowset or multiple resultsets. If you try to reuse the DataReader before
this is done, you'll get this exception.
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
www.sqlreportingservices.net
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:u1SomHHwFHA.2232@.TK2MSFTNGP11.phx.gbl...
> sql connections (until yukon), only support one request at a time. ther
> error mens a second request was made on the connection without the
> previous request reading all the result sets.
> ExecuteScaler only reads the first row of the first result set, it does
> not clear the results, you still need to close the underlying connection.
> also be sure your command objects are not shared - you will get the same
> results.
> if you are getting this with pooling on, then you are definitely sharing
> the data between thread in your code.
> note: be sure you are not using fields in a vb module, as these are shared
> across threads even if private. public/private just controls varible
> accessibilty not sharing.
> Public Module Test
> private myData as myObj = new myObj ' shared across threads
> End Module
> -- bruce (sqlwork.com)
>
> "Rob Nicholson" <informed@.community.nospam> wrote in message
> news:uz%23T7dGwFHA.2132@.TK2MSFTNGP15.phx.gbl...
>> I'm starting to worry a bit now. We're getting the above error when two
>> users hit the same database/page on an ASP.NET application using ADO.NET,
>> talking to a SQL 7 server. The error is perfectly repeatable :-( But this
>> should help!
>>
>> The error is occurring inside ExecuteReader which uses a DataReader
>> internally.
>>
>> Here are some things that I'm pretty sure it's *NOT*:
>>
>> It's not because our data readers are not being closed - they are. If
>> they
>> weren't being closed, then the same error would occur in single user
>> operation. It doesn't - it's only when two users (threads) are running at
>> once.
>>
>> It's not connection pooling as we've turned that off using Pooling=False
>> in
>> the SqlConnection connection string. I've verified it really is off by
>> watching connections open & close manually in SQL Enterprise manager.
>>
>> The two threads are not (AFAIK) sharing the same connection object. The
>> SqlConnection object is not in a shared or static variable - it's stored
>> as
>> a private variable within one of our classes (called MSSQL) in a variable
>> called m_Connection. This m_Connection variable is created each time we
>> open
>> a connection using m_Connection = New SqlConnection(ConnString), opened,
>> used (ExecuteScalar) closed and then destroyed using m_Connection =
>> nothing.
>> The instance of MSSQL is stored in the session cache but I've verified
>> that
>> the two users/threads are indeed using their own instance of MSSQL and
>> therefore their own instance of m_Connection. The two instances of
>> m_Connection will have the same connection string (SQL login used, not
>> Windows authentication).
>>
>> There are no exceptions/error conditions occuring elsewhere apart from
>> this
>> final error.
>>
>> I don't think it's the connection/data reader closing - I've triple
>> checked
>> all open/close pairs and the close is always within a Try...Catch with
>> the
>> connection closed in the Finally section.
>>
>> The error never occurs in our own use of data readers, only from within
>> ExecuteScalar. Hmm, I guess I could write my own version of
>> ExecuteScaler...
>>
>> So, pretty flummoxed at the moment. I willing to try any suggestions!
>>
>> Cheers, Rob.
>>
>>
> Does it happen in EVERY circumstance? It just sounds like your connected
> access is being hit twice simultaneously.
Yes, pretty much. When the two users hit the "Go" button, it always fails at
the same line.
Cheers, Rob.
> Are any of the objects involved being stored in Application variables?
No, session used throughout.
Cheers, Rob.
> sql connections (until yukon), only support one request at a time. ther
> error mens a second request was made on the connection without the
previous
> request reading all the result sets.
Hi Bruce,
Just to clarify this, this means one "SqlConnection" object can only handle
one request at once. I'm aware of this issue hence the reason I said I'm
pretty sure we're closing the data reader and connections each time (I've
countred the opens and closes).
> ExecuteScaler only reads the first row of the first result set, it does
not
> clear the results, you still need to close the underlying connection.
Yes, we do that.
> also be sure your command objects are not shared - you will get the same
> results.
Yup, not shared - created each time within a non-shared class/object.
> if you are getting this with pooling on, then you are definitely sharing
the
> data between thread in your code.
Nope, occurs with pooling turned off.
> note: be sure you are not using fields in a vb module, as these are shared
> across threads even if private. public/private just controls varible
> accessibilty not sharing.
Not sure what you mean by fields?
> Public Module Test
> private myData as myObj = new myObj ' shared across threads
> End Module
Nope, nothing like this anyway. The only thing we do have is code like this:
Readonly Property SomePointer As SomeObject
Get
Static CachedSomePointer As SomeObject
If CachedSomePointer Is Nothing Then
CachedSomePointer = GetThePointerFromSomwhere()
End If
Return CachedSomePointer
End Get
End Property
Cheers, Rob.
> Bruce is on to something here. If you don't close the DataReader (even
with
> an ExecuteScalar), the pending rowset will not be flushed until you do (or
We do close the data reader I'm pretty sure. The basic problem is I think
the datareader is being closed. If it wasn't then the error would occur when
a single user tried the operation. Therefore, it looks like *somehow* the
two threads are sharing each other's connections. But I'm 99% sure they are
not sharing the same connection object.
Cheers, Rob.
> Does it happen in EVERY circumstance? It just sounds like your connected
> access is being hit twice simultaneously.
I realised that I can set-up a test environment that should repeat this by
simply a loop into a page_load that simply executes 10,000 ExecuteScaler
statements:
For i As Integer = 1 To 10000
Dim NumPeople As Integer =
CIMS_App.DataServer.ExecuteScaler(SQL)
Next
The SQL being executed is Select Count(*) From People. The source for
ExecuteScaler, OpenConnnection and CloseConnection are included below. No
parameters are being passed in this example so that bit can be ignored.
Now this is where something strange happened. I ran the above code from
within VS 2003 and it crashes with "SQL Server does not exist or access
denied" error. I think I need to work out why this is happening first! Okay,
so firing off 10,000 open connections, select and close connection isn't
something that would normally happen but it shouldn't crash...
Later... if the loop is changed to this:
CIMS_App.DataServer.OpenConnection()
For i As Integer = 1 To 10000
Dim NumPeople As Integer =
CIMS_App.DataServer.ExecuteScaler(SQL)
Next
CIMS_App.DataServer.CloseConnection()
The error doesn't occur. It's the rapid opening and closing of the
connection that's crashing - SQL 7 box BTW.
Cheers, Rob.
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.SqlInternalConnection.OpenAn dLogin()
System.Data.SqlClient.SqlInternalConnection..ctor( SqlConnection
connection, SqlConnectionString connectionOptions)
System.Data.SqlClient.SqlConnection.Open()
Granite.MSSQL.OpenConnection() in
C:\Projects\CIMS_Dev\Granite\Databases\MSSQL.vb:37 9
[GException: Unable to open connection to INFORMED02]
Granite.MSSQL.OpenConnection() in
C:\Projects\CIMS_Dev\Granite\Databases\MSSQL.vb:38 1
Granite.MSSQL.ExecuteScaler(String SQL, SQL_Parameter[] Parameters) in
C:\Projects\CIMS_Dev\Granite\Databases\MSSQL.vb:50 1
[GException: Unable to load data from INFORMED02 server.]
Granite.MSSQL.ThrowOpenException(Exception ex, String SQL) in
C:\Projects\CIMS_Dev\Granite\Databases\MSSQL.vb:45 1
Granite.MSSQL.ExecuteScaler(String SQL, SQL_Parameter[] Parameters) in
C:\Projects\CIMS_Dev\Granite\Databases\MSSQL.vb:53 3
CIMS.DefaultPage.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\CIMS_Dev\Default.aspx.vb:78
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
Here's the code:
Public Overrides Function ExecuteScaler(ByVal SQL As String, ByVal
ParamArray Parameters() As SQL_Parameter) As Object
' Trap the database operation.
Dim AlreadyOpen As Boolean
Try
' Open the connection.
AlreadyOpen = OpenConnection()
' Create SQL command.
Dim SQL_Command As New SqlCommand(SQL, m_Connection)
' Add SQL parameters.
For Each SQL_Parameter As SQL_Parameter In Parameters
Dim p As SqlParameter
Dim Value As Object = SQL_Parameter.Value
If Value.GetType Is GetType(System.Byte()) Then
Dim Data() As Byte = Value
p = New SqlParameter(SQL_Parameter.Name,
SqlDbType.Image, Data.Length, ParameterDirection.Input, False, 0, 0,
Nothing, DataRowVersion.Current, Data)
Else
Throw New Exception("MSSQL.ExecuteScalar can't handle "
& Value.GetType.FullName & " data types!")
End If
SQL_Command.Parameters.Add(p)
Next
' Add transaction if enabled.
If Not m_Trans Is Nothing Then
SQL_Command.Transaction = m_Trans
End If
' Execute the command.
ExecuteScaler = SQL_Command.ExecuteScalar
Catch ex As Exception
ThrowOpenException(ex, SQL)
Finally
' Close the connection.
If Not AlreadyOpen Then
CloseConnection()
End If
End Try
End Function
Public Overrides Function OpenConnection() As Boolean
If m_Connection Is Nothing Then
m_Connection = New SqlConnection(ConnectionString)
End If
If m_Connection.State = ConnectionState.Closed Then
Try
m_Connection.Open()
Catch ex As Exception
Throw New GException("Unable to open connection to " &
m_DataLink.ServerName, GraniteErrors.Error0016, ex)
End Try
Else
OpenConnection = True
End If
End Function
Public Overrides Sub CloseConnection()
If Not m_Connection Is Nothing Then
m_Connection.Close()
m_Connection = Nothing
End If
End Sub
> The error doesn't occur. It's the rapid opening and closing of the
> connection that's crashing - SQL 7 box BTW.
Later...
It manages to open and close about 3,800 times before crashing out :-)
Cheers, Rob.
> within VS 2003 and it crashes with "SQL Server does not exist or access
> denied" error. I think I need to work out why this is happening first!
Okay,
Later...
Okay, we can ignore this error - see following KB article:
http://support.microsoft.com/default.aspx/kb/328476
Basically, if you don't use pooling (which is turned off at the moment for
debug), then opening and closing ~4,000 connections rapidly (sockets) causes
SQL Server to fall over. This is exactly what's happening. As I said,
normally you wouldn't do something like this but I'm trying to diagnose the
main problem with datareader.
Cheers, Rob.
Rob,
If you're caching connection objects that could be the same as placing the
object into an application level variable. Try creating new objects one at a
time instead of caching them and then testing. I believe that eventually one
changing one of the cached objects to a new one will solve the problem.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Rob Nicholson" <informed@.community.nospam> wrote in message
news:OWFc5HPwFHA.1256@.TK2MSFTNGP09.phx.gbl...
>> sql connections (until yukon), only support one request at a time. ther
>> error mens a second request was made on the connection without the
> previous
>> request reading all the result sets.
> Hi Bruce,
> Just to clarify this, this means one "SqlConnection" object can only
> handle
> one request at once. I'm aware of this issue hence the reason I said I'm
> pretty sure we're closing the data reader and connections each time (I've
> countred the opens and closes).
>> ExecuteScaler only reads the first row of the first result set, it does
> not
>> clear the results, you still need to close the underlying connection.
> Yes, we do that.
>> also be sure your command objects are not shared - you will get the same
>> results.
> Yup, not shared - created each time within a non-shared class/object.
>> if you are getting this with pooling on, then you are definitely sharing
> the
>> data between thread in your code.
> Nope, occurs with pooling turned off.
>> note: be sure you are not using fields in a vb module, as these are
>> shared
>> across threads even if private. public/private just controls varible
>> accessibilty not sharing.
> Not sure what you mean by fields?
>> Public Module Test
>> private myData as myObj = new myObj ' shared across threads
>> End Module
> Nope, nothing like this anyway. The only thing we do have is code like
> this:
> Readonly Property SomePointer As SomeObject
> Get
> Static CachedSomePointer As SomeObject
> If CachedSomePointer Is Nothing Then
> CachedSomePointer = GetThePointerFromSomwhere()
> End If
> Return CachedSomePointer
> End Get
> End Property
> Cheers, Rob.
> If you're caching connection objects that could be the same as placing the
> object into an application level variable. Try creating new objects one at
a
I'm beginning to suspect the fault lies in another of our developers code as
in the tests I mention above, I did this:
Begin
Open connection
Fire off 10,000 ExecuteScaler operations
Close connection
End
I then ran the above on four PCs at once, all executing the above code at
the same time on the same web server and that works flawlessly. This suggest
that they are not using the same connection object.
Actually, the current fault does occur in the same programmers code
everytime...
Cheers, Rob.
> I'm beginning to suspect the fault lies in another of our developers code
as
> in the tests I mention above, I did this:
This bug hunt is like a detective story :-) My suspicion that the problem
does like with the two threads attempting to use the same variables when
they shouldn't be...
The MSSQL object has a variable called m_Connection which holds the
SqlConnection object. It's created like this in OpenConnection:
If m_Connection Is Nothing Then
m_Connection = New SqlConnection(ConnectionString)
End If
When the program is run with one user, m_Connection is always nothing and
therefore creates the connection everytime.
However, when the program is run with two users, m_Connection sometimes
isn't always nothing so a simple trap like this fires:
If Not m_Connection Is Nothing Then Stop
This is a the cause of the error - the two threads ARE trying to re-use same
connection object hence the OpenReader problem.
The big question is WHY this is happening as it shouldn't... The
m_Connection object is in effect stored in the session cache. Each user
*should* have their own session cache and therefore own m_Connection.
Later :-)
Cheers, Rob.
> also be sure your command objects are not shared - you will get the same
> results.
> if you are getting this with pooling on, then you are definitely sharing
the
FOUND IT!! One of the other developers on the team had used a Private Shared
variable in a class which is a BIG no-no in ASP.NET land or in any
multi-threaded application. Therefore, User A and User B were sharing the
same connection variable - well actually they were sharing a higher level
object holding the connection so net result is the same.
Heads will roll I've spent most of my Saturday trying to track this down :-(
Thanks all for the suggestions.
Cheers, Rob.
There Is No Source Code Available For The Current Location
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
Hello,
I'm new to ASP.net and C#. I have attempted to debug one portion of our Web Application. I then edited some our code and rebuilt the project and now I cannot debug that area in the code. It says "There is no source code available for the current location" and prompts me asking if I want to view the dissambly.
What should I do?
--doc0tis
show us the source and highlite the line where your trying to set the breakpoint.
mcm
There Is No Source Code Available For The Current Location
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.
Wednesday, March 28, 2012
Thin client to thick client communication
I have an application that consists of both thin client portions and
fat client portions.
One such view consists of a fat client treeview on the left, and a
thin client asp.net webapp on the right.
A user will fill out the webapp's form and click submit. This will
send the data to the DB. I need to know of a way for the treeview
control on the left to be notified when the user clicks submit and get
all the data that the user filled into the form's fields WITHOUT going
back to the DB for this information.
Essentially what I want to do is this...if the asp.net webform were a
fat winforms based section, I could just hook up to a click event on
the button and receive the data through a custom eventargs class. As
far as I know I can't do this in asp.net webapps...so how do I
subscribe to the "event" that tells me the user clicked "Submit" and
send along the data in the forms fields to the treeview?
Thanks very much,
RussWhy use a thick client control?
[url]http://www.componentart.com/demos/treeview/features/core_features/default.aspx[/ur
l]
Fully .Net integrated control that mimics "thick client" application
behavior using DHTML. Cross browser compatible, affordable, easy to use...n
o
excuse to use ActiveX Controls to do tree menus IMO.
Thin client to thick client communication
I have an application that consists of both thin client portions and
fat client portions.
One such view consists of a fat client treeview on the left, and a
thin client asp.net webapp on the right.
A user will fill out the webapp's form and click submit. This will
send the data to the DB. I need to know of a way for the treeview
control on the left to be notified when the user clicks submit and get
all the data that the user filled into the form's fields WITHOUT going
back to the DB for this information.
Essentially what I want to do is this...if the asp.net webform were a
fat winforms based section, I could just hook up to a click event on
the button and receive the data through a custom eventargs class. As
far as I know I can't do this in asp.net webapps...so how do I
subscribe to the "event" that tells me the user clicked "Submit" and
send along the data in the forms fields to the treeview?
Thanks very much,
RussWhy use a thick client control?
http://www.componentart.com/demos/t...es/default.aspx
Fully .Net integrated control that mimics "thick client" application
behavior using DHTML. Cross browser compatible, affordable, easy to use...no
excuse to use ActiveX Controls to do tree menus IMO.
Third Level Domain And ASP.NET 2.0
domains, like test.MyDomainName.Com. I just cannot figure out how to get the
new development server to allow this, if its even possible.
I have already tried http://test.localhost:2600/NewProject/Index.aspx, and
it does not like that. Then I added test.localhost to my host file to resolve
to 127.0.0.1 and tried the same URL again and it works, but ASP code of
Request.Url.Host only returns localhost. I have poked all around in the
properties in the request object as well as the request.url object and cannot
find anywhere were its picking up my domain prefix.
Anyone dealt with this before?
Thx in advance!
RossWhat you need to do is run a DNS server on your development server's box,
configure your test subdomain, and use IIS instead of VS 2005's internal server.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Ross Nornes" <RossNornes@.discussions.microsoft.comwrote in message
news:69D28053-658E-41F6-B778-D4BD2FFAD1E8@.microsoft.com...
Quote:
Originally Posted by
>I need to write and test a new ASP.NET 2.0 application that uses third level
domains, like test.MyDomainName.Com. I just cannot figure out how to get the
new development server to allow this, if its even possible.
>
I have already tried http://test.localhost:2600/NewProject/Index.aspx, and
it does not like that. Then I added test.localhost to my host file to resolve
to 127.0.0.1 and tried the same URL again and it works, but ASP code of
Request.Url.Host only returns localhost. I have poked all around in the
properties in the request object as well as the request.url object and cannot
find anywhere were its picking up my domain prefix.
>
Anyone dealt with this before?
>
Thx in advance!
>
Ross
Cool, thx for the reply Juan!
I figured it out now. People dont call these "third level domains" like I
do, I guess the more common term is "subdomain". :-) Go figure... Found lots
more info on Google after figuring that out...
Between your response and a few reponses to the subdomain google queries I
did, I took a little more simplistic approach since I did not want stand up a
DNS server on my box.
For anyone else wanting a solution, what I did was setup the Windows XP IIS
default website to point at my new ASP.NET 2.0 website I'm developing, I
edited my host file and created domains in there like test1.localhost.com,
test2.localhost.com and pointed them all at 127.0.0.1, then set up these test
subdomains as host headers in the default IIS website and bingo, I have a
functional test enviorment!
Thx!
Ross
"Juan T. Llibre" wrote:
Quote:
Originally Posted by
What you need to do is run a DNS server on your development server's box,
configure your test subdomain, and use IIS instead of VS 2005's internal server.
>
>
>
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
===================================
"Ross Nornes" <RossNornes@.discussions.microsoft.comwrote in message
news:69D28053-658E-41F6-B778-D4BD2FFAD1E8@.microsoft.com...
Quote:
Originally Posted by
I need to write and test a new ASP.NET 2.0 application that uses third level
domains, like test.MyDomainName.Com. I just cannot figure out how to get the
new development server to allow this, if its even possible.
I have already tried http://test.localhost:2600/NewProject/Index.aspx, and
it does not like that. Then I added test.localhost to my host file to resolve
to 127.0.0.1 and tried the same URL again and it works, but ASP code of
Request.Url.Host only returns localhost. I have poked all around in the
properties in the request object as well as the request.url object and cannot
find anywhere were its picking up my domain prefix.
Anyone dealt with this before?
Thx in advance!
Ross
>
>
>