How can I prevent catch on my entire application?
View Complete Post
I'm using a static Timer in my Global.asax to run a method at regular intervals. When the method throws an exception, my application is stopped. I have used an empty catch to prevent exceptions from stopping the application something like below code. Is there a disadvantage to use such an approach?
protected void Application_Start(object sender, EventArgs e)
public class TimerStarter
private static System.Threading.Timer threadingTimer;
public static void StartTimer()
if (null == threadingTimer)
threadingTimer = new System.Threading.Timer(new System.Threading.TimerCallback(CheckData),HttpContext.Current, 0, 50000);
private static void CheckData(object sender)
// a method that reading xml file from another url
// empty catch to prevent stopping the application
The situation is I have a daily batch job running SSIS package using the SQL Server Agent. In the daily batch job, the program will generate many dynamic SQL statements and put all SQL statements in a temp table #updateSQLTable. Then, use a cursor to loop
through the temp table #updateSQLTable and execute the SQL statments.
The following is the code segment in the cursor:
begin tran t1
--start generating dynamic SQL statements
--after generating dynamic SQL statements
declare @updateSQL nvarchar(4000)
DECLARE mycursor CURSOR
FOR select updateSQL from #updateSQLTable where updateSQL is not null order by updateSQL
FETCH NEXT FROM mycursor
WHILE @@FETCH_STATUS = 0
--execute the generated dynamic Insert/Update SQL
EXEC sp_executeSQL @updateSQL
would any body please help me to catch the exception if the column doesnot exist as my table columns are not static.
sometimes its throwing me indexoutofrange exception as the column doesnot exist
thanks for the help guys
When is the .NET Garbage Collector unable to reclaim memory? The answer might surprise you. Stay tuned.
MSDN Magazine January 2007
MSDN Magazine February 2001
i need to prevent loading big images e.g max 100KB
but i only store url
1. user put url with image (i remember this string in database not image itself)
this cause that i can not check image size before store url in database
because user can store url and after this operation put bigger file at that location)
2. my web page generate some different image based on first image
and i need to load portion of image
to stream and set buffer size to 100KB + 1 Byte
if stream is larger than 100KB that user put bigger file
how can i accomplish that?
FileStream can not use URI as location only disc location
what should i use instead?
Hi Experts ,
I searched over the web but no luck so far and thought of getting some help form gurus .
Did any out really implemented a way to handle concurrent logins ?
Please not that i'm no using either forms authentication or Roles/Memberships , I do have custom authentication for my website .
I'm sure it is someway related with global.asax file handling something in application events and session events but unable to figure this one out .
Any pointers will highly be valued and appreciated .
Thanks a tonne in advance .
How can I catch this exception? I do not want it to stop my page execution. Can/Should I do that?
Server Error in '/' Application.________________________________________Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally
I wanted to know how to prevent more than one user from
uploading the report at a time .I am new to .net ,plss help with the
code that would be great.Details are below:
This is a Windos based
app written in c# . When User A clicks Upload option on one server
from the menu to upload the files and at the same time when User B
clicks Upload option on different server , User B should be alerted a
message saying "User A's uploading is in progress,pls wait" . How to
achieve this, plsss help with the code.. I am thinking this logic should be kept in a stored proc, How do I write that proc? plss help
Thanks in advance!
I'm a big fan of the Colleague Tracker web part in MOSS 2007 My Sites, especially the option to show 'Membership Changes'. This is often useful in highlighting that a colleague has been added to a certain AD group.
We now want to hide the membership of certain AD groups from the colleague tracker. For example, if an AD group called 'Project X' is created, we don't want membership of the group broadcast throughout the My Sites where colleagues are tracking colleagues.
My first thought was that we could use AD to 'deny read' on the 'Project X' AD group to all SharePoint related service accounts. This does not appear to have worked, although perhaps the configuration is more complex? The best approach would seem to be to
prevent the group membership data ever being imported from AD to the SSP, hence my 'deny read' approach.
Has anyone successfully implemented this, or does anyone have any better ideas?
I have a problem w/ a web app which is probably fairly common, but I cannot find any solutions anywhere. Hopefully someone will have an idea.
The web app in question provides a UI for editing a client (in the business sense, not the browser sense), identified by a ClientID. I store the ClientID in Session, which gets passed from page to page, along with a number of other pieces of data in Session. Works great.
The problem is that if the user opens a new browser window using Ctrl N or File->New Window (in IE), the new window comes up with the same page as the current page, with the same session info. Then if the user navigates to a different client in the 2nd window, the ClientID in session refers to the new client. If they go back to the original browser window and save, the original client gets saved using the 2nd ClientID, and all hell breaks loose, because now the data from the two jobs are intertwined.
I have enabled trace and verified that the new browser window uses the same SessionID as the original. If an entirely new instance of IE is opened, it has a different SessionID, so is not a problem. I have not yet investigated other browsers, such as Chrome or Firefox.
Is there any way to determine if a browser instance is opened for a web app which is already open in
I have a button which starts processing.
I want that when ever a button is click from page1.aspx .. a count down timer should start and displayed on page2.aspx.
I am thinking of using iframe to join 2 pages.
Please let me know your suggestions.