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

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

Automatically Execute Code at certain time from website

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

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.


View Complete Post

More Related Resource Links

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 this code be setup to run against the whole database instead of just 1 record at a time?


We have made some changes to this code to start capturing 1 new field of data and updating it as new records are added. But there is currently about 120,000 records more or less.. those records of course dont have the new field populated with anything..

We would like to run this logic that already in place and run it against the tables to update the fields 1 time. I think to make it easier, if it can be setup to expect the "valueTwo" variable, so that we can run it againt the individual codes instead of doing all the records at one time.. there are codes that only have a few records, so it would be best to test initially against the small code group.


            strSqual = "insert into trans (trans_type_name, trans_date,sys_id,mod_user_id,show_ind, remoteCode, techName) values('" & valueTwo & "','" & TransDate & "',"&strSystemID&", 1,'T', '" & dbQuote(strUser) & "', '" & strTechName & "')"        
            'get the new transaction_id out for just inserted alarm   
            strSqual = "select max(transaction_id) as transaction_id from trans"  
            set rst = getStaticRecordSet(strSqual)

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

XML Comments: Document Your Code in No Time At All with Macros in Visual Studio


Starting in Visual Studio 2005, XML documentation support will become available in Visual Basic and C++ as it has been for C#. However, making full use of the many comment tags will take a little extra work In this article, the author shows how Visual Studio macros can be used to automate the creation of XML documentation and creates macros that write large sections of comments with just a keystroke.

Tony Chow

MSDN Magazine July 2005

Question about user used to execute code from app_code


 Hello. I would like to know something about code execution  in App_Code folder.

Under wich user executed code from app_code.

I'm using impersonate in web.config

What is this Mysterious Javascript code in my asp.net website doing???


I have an asp.net website(using Visual studio 2008), when i debug the site on my development machine, it loads well with out any errors. At this point i leave the site running in debug mode but i notice strange things. 

0). When i right click the file and check the properties, it has a URL property whose value is http://cdn1.predictad.com/scripts/publishers/suggestmeyes/predictadme.js?si=7495

1). In my sites Solution Explorer, there appears a folder called "Windows Internet Explorer". Under this folder, there is a file called predictadme.js?si=7495. When i open that file, it contains the code below. (Apologies, i failed to format the code, only saw options for C#, C++, CSS, VB, XML/HTML, Razor, SQL when  trying to insert code and i think the code below is non of these)

I dont have idea where this code is coming from, but the presence of the string .facebook. makes me suspicious. I have a feeling some thing fishy is happening but am really not any where near good at javascript (scripts), so am seeking

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


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.


How it's possible to execute this code in C # WPF

Hi I have this code but I do not know how to do him in WPF   IF EXISTS (SELECT * FROM YourTable WHERE Key = 123)    PRINT 'EXISTS' ELSE    PRINT 'Dont EXISTS'   There is My Code in c#         private void button2_Click_1(object sender, RoutedEventArgs e)           {             DataSet ds6 = new DataSet();             SqlConnection con6 = new SqlConnection("Data Source=PC;Initial Catalog=Veo;Integrated Security=True");             SqlCommand cmd = new SqlCommand("Select * from [MHGROUP].CUSTOM3", con6);             SqlDataAdapter sqlDa6 = new SqlDataAdapter();             sqlDa6.SelectCommand = cmd;             sqlDa6.Fill(ds6);             string mySelectedValue = comboBox2.Text;             int newid;             newid = Convert.ToInt32(mySelectedValue);  

Is it possible to response SMS automatically in ASP.net when website or web application is closed?

Dear friends, In my problem statement user sends a SMS to GSM Server by mobile phone and the website or web application will return an answer even they be not opened. Is it possible to response SMS automatically in ASP.net when website or web application is closed? Thanks for your help Mahyar

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

Changing case of all URLs in the website source code from Sentence to Lower

I only want to change case (Mixed to small) of URL in HREF attribute, nowhere else. This is just for convention purpose. eg changing   Its <a href="http://www.abc.com/S pecial-E dition.aspx">Special Ediation</a>.  View <a href="http://www.abc.com/O ther-N ews.aspx">Other News</a>.   to   Its <a href="http://www.abc.com/s pecial-e dition.aspx">Special Ediation</a>.  View <a href="http://www.abc.com/o ther-n ews.aspx">Other News</a>.

How to automatically run code and send emails?

Hi all- I would like to have users set some parameters, then have routines run in the middle of the night and if the user parameters are met, have an automated email sent to update the user at various time intervals as set by user , ie daily, weekly, monthly, etc.) Can someone please point me in the right direction on how I go about doing this?    

execute a javascript function in code page

I use js function in source page and call that js function as below in Source page<a href="javascript:;" onclick="openwin('Sample.aspx?DID=<%#Eval("UID") %>', '', '700','300','yes'); return false ">I need to call this function from vb.net code page.....how to solve this ........???????????Give ur ideas...............

Deployment of Website created VS2005 with VB.Net code behind

Hi everyone, I am newbie creating websites.  This is my first and I am having problems with deployment and accessing.  Either I am doing something wrong or I am leaving something out.  I have tried several different methods of deployment using VS 2005 Professional version.  The website will be used by internal users, using company's own servers.  Deployment methods appear to be successful, but I do not see how to run the website.  I guess I need the step by step instructions on deployment.

Automatically inserting server-side page events into C# when using code separation

I know this is a really basic question and I have spent the last half hour trying to find an answer so please forgive me if this has been asked before (it probably has)....When I create a web page with the C# code placed in a separate file I can't seem to easily add page events (apart from Page_Load). When I open the C# class code for the page all I see in the two drop-down boxes above the code is "Default" (with no other options in the drop-down) in the left-hand box and "ApplicationInstance,form1,Page_Load(object sender,EventArgs e),Profile" in the right hand box. I can't see a way to create the code for the other page events from either of these drop-downs.If I keep the C# code in the same file (i.e., not use code separation) everything works fine - I see "Server Objects & Events, Page, Form1, etc..." in the left hand drop-down and I can create new events in the right drop-down when either Page or Form1 are selected in the left box.Am I missing something really obvious?Many thanks for any suggestions

Service is executing code after time out.

Hi All,  I am using IsOne way and nettcp binding in mu WCF. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,ConcurrencyMode=ConcurrencyMode.Multiple)]   public class FlexiAsyncServer : IAsyncInterface   {       public void OneWayRequest()         {              for (int i = 0; i <= 5000; i++)                 {                     DbCommand cmd = dbAsync.GetSqlStringCommand("insert into  JOB_DEFNN (JOB_NM,JOB_STAT_CATG_ID,JOB_GRP_ID) values('"+i.ToString()+"',1,101)");                     dbAsync.ExecuteNonQuery(cmd);                 }           } } In Service side before inserting this 5000 records into database i am getting time out error in client side. But though i got error the records are being inserted until it complets 5000. My question is why the service side execution is not stopping a
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