Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6877515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:36:34+00:00 2026-05-27T04:36:34+00:00

For a application with a database in C#, I need to call a function

  • 0

For a application with a database in C#, I need to call a function every month just once(on a defined day). It is necessary to check on every start of the application, if the defined day, which is registered in the database, has already been this month and if that, not to call the method again.
What would be the best way to solve? Save month and year in the database too and check if actual date > than the values in the database?

Is there a more easy way?

EDIT 1:

If I try to do that with the Windows Task scheduler, how can I contact that with C#?
My method is a Sql-Insert-Statement, that has to be done every month once on the same day.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:36:35+00:00Added an answer on May 27, 2026 at 4:36 am

    A scheduled task, windows service or sql server agent would be better (if you have a server available).

    Failing that – and provided that the function doesn’t have to run on a specific day, then your solution above seems fine.

    If the function must run on the 1st can you rely on your app being ‘on’ at that time?

    edit: so….you have some kind of c# application with an mdf in folder somewhere. You have an insert that must run on the 1st of the month.

    I would create a scheduled task on the machine that has the app. The task would call another (tiny) C# program (.exe) command that has a connection string to your db*. This app gets called once a month and does the insert.

    *Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, once a user leaves a webpage in my application, I need to call
I need to build a simple, single user database application for Windows. Main requirements
I need open source database that I can ship with my commercial application. It
I need to change database and settings when my customers load the application (xap)
I need to highlight changes(diff) between 2 database text fields in a asp.net application.
We are creating a rails application for an already existing database. We need to
I am using LINQ-to-SQL for an application that queries a legacy database. I need
I'm working on an application which accesses data from an Oracle 11g database. I'm
TL;DR Summary: I need a single command-line application which I can use to get
I'm building a multi-threaded windows service application in Delphi XE2 which uses ADO database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.