.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Execute a function for specific time (not at specific time)

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

I have a function that does large amount of processing.

I just want that if it executes in specific time (say 10 min) then it should return "execution successful".

But if now then i want to stop the execution of that function and return "unsuccessful" and rollback my transactions.

Returning and rollback is fine.

But i dont know how to stop the execution of a function at specific time.

I am using asp.net with C#.

Any ideas would be really appreciated.


View Complete Post

More Related Resource Links

Date Time Formatting to a specific dateformat

Hello All,I have been struggling with this for a long time. I have a form in which there is a textbox using an ajax calender extender. Now, the problem is that, I want to take the Date value which is string format and format it to a specific date format before inserting it into the database. The following is the core problem:Dim MDate as string=txtMeetingDate.Textdim d as new Datetime' I want to convert the d to a datetime using the Mdate/// The problem is that I don't know what's the date format in the TextBox because users can use any time format they want, it is based on their windows settings!!!So, I am struggling to change my String (MDate) into a DateTime in the same format the user have and then convert it into my format:"dd/MM/yyyy" and after I have the date in the correct format, I want to change it back to string and save it in the database.I am doing this so that I have the same dateformat saved in my database.Any Ideas? ThanksAMB

Creating a timer job which runs only once at a specific time



I want to create a timer job which runs only once at the 'specified date and time'. How to create the job? Should i delete the job after it runs?

Visit SharePoint User group - India

Returning record from History Table as it would have existed at a specific date/time


I have a table that uses a trigger to save changes (old values) to a history table. This process is working fine, and I have reports that detail the history of a record for the end user. My problem is that the end user now wants a report that will retrieve how the record looked at a specific date/time.

Source Table:

Id	First	Last	Active	Date
1	John	Doe	1	10/25/2010
2	Jane	Smith	1	10/25/2010

History Table:

Id	SourceId	First		Last	Active	Date
1	1		Jonathon	NULL	NULL	5/1/2000
2	2		NULL		Gray	NULL	10/1/2000
3	2		NULL		Smith	NULL	6/15/2003
4	2		NULL		Doe	NULL	11/23/2008

If the user queries for SourceId 2 on 1/1/2009, they need to get:

Id	First	Last	Active
2	Jane	Smith	1

I've used COALESCE searching multiple fields, but I need to figure out how to

Measure if someone made a transaction at a specific time


I have a Campaign Date Dim, a Campaign Time Dim, Transaction Date Dim and a Transaction Time Dim, they are shared Dimensions


A specific Campaign is sent of at a certain Date and Time to specific Subscribers.


I want to create a measure that is 1 or 0 if that subscriber made a transaction within 60 minutes of receiving the campaign. I already have a measure which shows a 1 or a 0 of the campaign was sent to that specific subscriber.


So I have a list of subscribers campaigned to, now I need a measure to show if the responded within a certain time.


It sounds simple but I have no idea


I was thinking of a CASE statement that shows a 1 if any transaction is within 60 minutes their campaign DateTime





getting page refresh after specific time

Dear All, when I wanted to automatic refresh page that time i putted a line as below Response.AppendHeader("Refresh", "30"); in my page Load event. but now I don't want to refresh page so that i comment that line but still my page getting postback after specific time. so please tell me what can i do for this thanks...

UI on the Fly: Use the .NET Framework to Generate and Execute Custom Controls at Run Time


Creating UI controls on the fly can be accomplished via run-time code generation. And there are lots of reasons to do so. Generating these controls once and then reusing them as needed is more efficient than generating the controls each time. Read on.

Morgan Skinner

MSDN Magazine December 2005

Automatically Execute Code at certain time from website


Is there a way to trigger a piece of code to execute at a certain time once a week?

I basically want my website to send out a reminder email every sunday. I have a function called SendReminder() and I would like to know if it is posible for it to run by itself because at the minute I have to press a button to run it.


How to execute a set of steps N time, in parallel?

I have a custom workflow activity that creates "tasks" for users to do.  Tasks are shown to a specified user when they log in to the web site.  When this step runs, it takes in a userId, creates a task in the database for that user, and then sets a bookmark.   When the user goes to the web site, they see their tasks.  When they push a button to complete a task, the bookmark is resumed and the step ends.   So far so good.  The problem is that the design now calls for the workflow to be able to kick off multiple tasks for multiple users, and that all the tasks be started at once (that is, its not good enough for user #1 to receive a task, complete it, user #2 receive a task, complete it, etc.  All the users should receive their task to start with, and then they can finish them in any order.)   I can't do this serial with a for loop, since then there'd only be one task "outstanding" at a time, and they'd have to be completed in order.  I can't simply modify the custom activity to take in the multiple pieces of data, because there's a lot of other items that happen in the workflow that need to be done before and after the custom activity for each task.  What I'd really like is something like the Parallel activity, where I create the branch and place all the tasks, but then I can assign the number of times

Is there a function in Jquery which run only one time no matter load page or PostBack

In asp.net, I can use Method A to run somethings A one time, and somethings A will nor run when page is postback but In JQuery, I hope to run something B one time when the page is loaded, but if I use Method B, the "Somethings B" always run even the page is pastBack, how can I do? Thanks! ------------------Method A------------protected void Page_Load(object sender, EventArgs e){    if (!IsPostBack)    {       //Do Somethings A    } }   ------------------Method B------------$(document).ready(function () {   //Do Somethings B})

can the void main function be called all the time, when activated as a feature.

Hi, I have a console application using C#, in which i have a custom code under the static void main. I would like to know, if the console application is made to a feature and activated, will the static void main function be called all the time, without waiting for any events to be trigerred. Thank you

Execute a SSRS Report from CRM using URL to output to PDF with a specific file name


We have a CRM installation from which I am trying to do some reports which use the CRMAF filters so the reports are sensitive to entitiy selections.

eg execute a sales report for a number of selected accounts.

The specific RDLs have been created in VS2008 and uploaded to the reporting server via the Report import tools within CRM and all work as expected however the output of the report is in HTML via the web browser.

I have changed the configuration of the report in CRM so that it uses the URL method like below so that the report is rendered into PDF which is great.



This method prompts for the user to open/save the PDF file which is acceptable however I would like to replace the default file name (which is the report name) with one of my own.

For example rather

how jquery function one time writen and call many butoon


how to call this function in two or more button one time wirtten

<asp:Button id="Bu_DocShareSave" runat="server" Text="Add Share"  OnClick="Bu_DocShareSave_Click"/>
                                     <asp:Button id="Bu_DocRemoveShare" runat="server" Text="Remove  Share" OnClick="Bu_DocRemoveShare_Click" />

<script type="text/javascript">  
     $(function () {  
           $('#btnFoo').click(function () {  
               var commaSeparated = $('#<%= ListBox2.ClientID %> option')  
                .map(function () {  

How to make NUnit execute only a specific test


I set Nunit to run automatically when I run my class library project like this

/fixture:abc.Integration.Tests /runselected abc.Integration.Tests.dll


When I run in class library project, it starts running all the test in Nunit Test project. How do I specify 'exact one' test which I want to be run instead of all tests or last run tests?

SQL Server 2008 query execution time is different if i execute it in management studio or from code

When I execute query from software which i wrote in c# it required lots of time to complete but if I execute exactly the same query from management studio it will be done in seconds. In both cases execution plan is the same. 

Can I write multiple queries in Execute SQL Task Editor at a time


Can I write multiple queries in Execute SQL Task Editor at a time???


Can I write these two queries???

ALTER Table [Islamabad_campus]. [dbo]. [BS_Students] ADD Location   VARCHAR ( 10);

UPDATE [Islamabad_campus]. [dbo]. [BS_Students]

SET Location = 'Islamabad' ;


how to change infopath form time (function now())

my infopath form has a default time now() for the field. my sp2010 server has correct time and time zone, for example 4:11pm EST now, but when open the form in sp2010 web browser form, it shows 1:11pm. any idea how to fix it?
however, if I do preview, it shows correct ime 4:11pm

Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend