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

Top 5 Contributors of the Month
Post New Web Links

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

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :SharePoint


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

View Complete Post

More Related Resource Links

Customer Timer Job runs at different time


Hi All,

I have a custom timer job that I set to run at 8AM every day.(code below)

It does not run at 8AM instead it runs randomly during the day(but only once though)

How do I make sure that it runs at 8AM every day. Anything wrong in my code:

Thanks in advance.



override void FeatureActivated(SPFeatureReceiverProperties properties)



// register the the current web


Erro While Creating a Solution Package With a timer Job


Hi All,

I am trying to create a test Timer job in SharePoint and want it to be deployed as a solution package. I am using a web application project and added Timerjob.cs, fetaurereceiver.cs, feature.xml and manifest.cml files in in. Then I created a .dff file to arrange the solution package. But when I tried to create a solution package with makecab.exe i got the below error

100.00% flushing current folder

I dont know what to do with that . Please if anyone can send me an example where a timer job was deployed as a solution package it will be of great help




Isha kapoor My SharePoint Blog Follow me

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.


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

Feature with wsp for creating specific groups on any site creation

hi, i need to create a sharepoint feature for wss 3.0 with .wsp (wsp for easy deployment) which do folowing funtionality: Ability to run some custom code for creating specific custom groups on every site creation. Feature needs to be activated when deployed so when user create new site it creates groups based on our custom code( i have custom code for creating gorups just need to know how to attached it to feature which works on every site creation event) Any workable example is very helpful for me because i am very confuse and already did reasearch on that. i guess feature stapling is not the solution in my case. Thanks in advanced shaheen

SPListItem "Start Time" for recurring events when building a task reminder Timer job.


I have a timer job that looks at maintenance events (calendar list) planned 5 days in the future and moves them to the current todo list. It then marks that maintenance item as copied so it is not double copied to the current todo list.

This works good for single event maintenance items but not for routine or recurring maintenance items. The reason is the recurring events have a "start time" of the first event so after the first one gets moved the rest are all interpreted as being in the past, since (I think) the recurring events start time is generated as an offset of the original event at runtime. How would I get a collection of ALL the Event items that are 5 days out (single and recurring) within a timer job.




Expanded recurrence items cannot be updated

Configure Navigation Inheritance at the time of creating the site


Hello All,

I am creating new site in my web application with the template team site. While creating the site I have to click More Option and select the "Yes" for "Use top link bar from the parent Site?" So Is there any way to set it default yes. It is set as "No" default, I want to change it "Yes"...


Can you please help me out to get the scenario solved???

Thanks in Advance.

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





Login Audit Failure every time Agent runs


Hi everybody,


we're running several SQL-Servers 2008 (on Windows 2008 Servers). Every SQL-Server is using it's own domain accounts for running the services.

Every time a task is executed by an SQL-Agent, I find a Logon Audit Failure in the system log. The Details are listed below. The audit failure refers th the domain account fpr the SQL-Server Agent.



  - Provider
   [ Name]  Microsoft-Windows-Security-Auditing
   [ Guid]  {54849625-5478-4994-A5BA-3E3B0328C30D}
   EventID 4625
   Version 0
   Level 0
   Task 12544
   Opcode 0
   Keywords 0x8010000000000000
  - TimeCreated
   [ SystemTime]  2010-10-31T19:00:00.561331400Z
   EventRecordID 84856

  - Execution
   [ ProcessID]  604
   [ ThreadID]  13824
   Channel Security
   Computer myFullyQualifiedServerName


  SubjectUserSid S-1-5-21-693660846-2196240602-4257949084-21503
  SubjectUserName myServiceUserName
  SubjectDomainName MyDomainName<

Question on Creating Aggregations based on Time data in a Cube



I have a fact table that lists projects and the site visit dates that related to those projects.   For each site visit date there are a number of associated KPIs.

However to make life a little bit more complicated these KPIs are prorated by year so for each site visit there may be several rows in the fact table that relate to each year ie 2005,  2006 etc...

The issue I am having is that I have been given a requirement to view each KPI at the site visit level.   My first idea was to create an aggregate table for each site visit with totals for each year ie  2005 sales total,  2006 sales total etc...    The issue is that totals can be for any year between 2005 and 2014 and clearly creating all these hard coded totals means there will be a huge number of KPIs required with in-built time logic at the site visit level ie for each KPI I would need a separate measure for each possible year.

Any other alternatives?   The underlying fact table will of course show the end user a list of site visits and the KPIs relating to each year,  but the end user wants to be able to view the data in a repivoted format so that site visit returns 1 row with the prorated date columns appearing vertically across.   For the time being I cannot see that this is possible without having a huge agg

Creating Functions and Displaying the time in C++


Ok, How would I be able to display time in a form for C++? I just need the time not the date though and I need this to appear in a label. I saw the Visual Basic code but couldnt find the one for C++.


I am making a test and I want to have different test versions...My second questions is how can I create a function for every test version and depending on the checkbox, it does what is inside a certain function?

For example:

void TestA()


label->text = "Question 1: NaCl";

if (textbox->text = "sodium chloride")

return 0;

How would I turn this into a Windows Form Function and just call it when someone presses a checkbox.


My very last question is, how can I simplify my code for checking if a answer is correct? I want to give the test taker two tries and if they dont get it right on the third, I want it to display the answer...

I have tried loops, and writing out the complete code, but it is too messy. Does anyone k

First Time Creating a StoreProc; Not Working Very Well...


I am trying to create a StoreProc to sweep data from a .csv file, saved on a network drive, to a Table, in SQL Server.  I’m kind of new to SQL Server, and need a little help with this task.  I thought this link offered a good suggestion:



So, I created my StoreProc; it looks like this:

-- ================================================

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...

How to minimize time when creating 2005 merge replication with very large data files and log files?


Dear all,

We're using window server 2003 sp1 + sql ent 2005 sp2 with merge replication between 2 servers. Since 1 of server sql is down, we need to create merge replication again. However, our data file size is 60Gb and log size is 40 GB and when we create merge replication it may need more than 10 hours to finish which is unacceptable since when creating replication the online db normal service operation may be affected. Is there any other way that can reduce the replication creation time within 5 hours to finish? Thanks a lot.


P.S: we are using full recovery model and plan to change to simple recovery model. Any help?




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.

Creating your SharePoint Governance Plan

One of the most common questions that I get from prospects as I'm talking to them about the creation of a governance plan and process is what does it look like. In other words, there are materials available which describe what should be in a governance plan but there isn't a ton of guidance on what the process of creating a governance plan and process are.
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