I am writing a website that will be using an SQL database. However I am needing the database to be updated with real-time information. I have no problems doing this as I have written a C# program to do this. However as I want this data to be updated 24/7. It's not appropriate to run it on my own machine. Any suggestions would be greatly appreciated!
There are many options:
If you have a dedicated server:
Create your application as a console application and put it in startup
Create your application as a console application and using Windows Task Scheduling run it with your required frequency.
Create it as a windows service that will always run
If you don't have a dedicated server:
Use libraries like Quartz to perform task scheduling in your web application
Assuming that by saying SQL you mean Microsoft SQL Server...
As already told the optimal solution is to code a Windows service. In case you are working with express edition of visual studio this can be tricky without the related template which is available only on paid edition or with 2017 community , so a possibility is to make an executable program and activate it using task scheduler and the repeat every option.
To be honest I would prefer to keep everything inside SQL , using SQL server agent you can execute jobs defined among SSIS , basically a rebranded and extended DTS which can easily operate on DB, have a better logging than the primitive OS task scheduler. No need to go on was or cloud, it is just a SQL server function that need to be enabled by the DBA, if not already used.
Related
I wanted to run .NET window service/c# script as background process in AWS and I'm very new for AWS, So if anybody can suggest that how can I schedule my window service over the AWS to execute it every day based on time set?
The simplest way is to test and develop you C# windows server locally, and then use RDP to connect to the EC2 instance and re-install it there.
There is nothing special about running an EC2 instance - its just another Windows server (in this case) that you can install whatever you want on it.
Thats the basic minimum you need to do; of course, once you learn more about AWS there is probably a lot more you could do, i.e. setup automated deployments so that when you update your service it gets deployed automatically, autoscaling it, load-balancing it, taking snapshots and backing it up etc -
But, just to get up and running, just install the windows service like you would on any other windows machine and you can build from there.
I want to invoke a c# application based on SQL server database. I have name's column in database. I want to check if there is any name present in the database then every after 1 hr my C# application should get invoked. I am asked to use a "job" concept in SQL server. Is it possible to perform this operation?
Job schedules are designed to do maintenance staffs. They actually do something periodicall, but the things they do is about backups, running T-SQL jobs, CleanUp and etc. I don't think doing this by an SQL job agent be a good solution.
If you want to check db in a constant interval, then you could simply write an intermediate app (windows service or a console App) and check your db changes every 1 hr. If your desired changes happened then invoke your C# application.
You could call a windows application using a shell. You could do it in an SQL server job or in a trigger.
Hope I helped!
I'm making an application in C# with VS 2012 that checks a database every 15 seconds and perform some actions when it finds data. Right now I've created a Console Application so I can debug it easely but during relese this application needs to run in a IIS server.
How can I do that? I've read this question but it looks like some sort of workaround because to run it I need to perform these steps. Right now I'm reading the docs about Windows Service Application, Is this the right way?
EDIT Sorry but I've never used Windows server before, so as people pointed out IIS is only a web server, the thing I need to do is run my application in a Windows Server environment
IIS is a web-server and accordingly it should be used for hosting web applications.
Develop a windows service which does the job of checking the database in intervals and invoke a web service (which you can host in IIS)
If your application is performing some data query and manipulation on the server then I would recommend the approach to host it in a windows service.
Some advantages to this are:
The service will start and run independently of a user logging into the server.
You can configure the service to recover should it experience an exception (ideally not!).
The service will start automatically (if configured) when the server restarts.
You can configure which user group (or user) the service should run under so you have a more granual approach to security.
As it's running as a seperate process, you can monitor its memory and processor utilisation.
Debugging is slightly more cumbersome but not difficult, one approach I've used is to install the service locally, start it and then attach to it via the debugger. This question describes another approach I've also used.
I want to know if it is possible to use MySQL Engine without having to install WAMP Server. I'm developing an application that will require a database, so I was thinking of using MySQL instead of MS SQL or access. So I don't want to install the WAMP package yet I want to install the MySQL Engine, so if possible, please provide me with the download link for the MySQL and how to install and use (start/stop service).
You will need the runtime and the .net connector to make this happen. You also might find the workbench (gui tools to manage the server and run queries) to be helpful.
The runtime installs a service by default, which you can control on the commandline or via the windows service management console (services.msc).
This sounds to me a lot like you're thinking 'desktop application', where the MySQL database will be a simple local data store. If that's the case, MySQL is not a good choice.
MySQL is a server-class database engine. It's designed to run full time in the background as a service. This makes it overkill for a simple desktop app, and as a user I'd be mad if your simple desktop app required me to run the MySQL service.
For the kind of app I think you're building, you really want an in-process or desktop-class database. Good examples include SQLite, SQL Server Compact Edition (not Express), or even MS Access. Any of those would be a better option here than MySQL.
On the other hand, if I'm wrong and you're building a web app or an app that will be distributed to several computers that all share the same database, then MySQL is a perfectly fine choice and you should read #Femaref's answer.
If your database isn't going to be incredibly large you could go with SQL Compact. It comes with the .NET framework, and works well for smaller databases.
I have developed an application as my college project using Visual Studio 2005 and SQL Server Express. Up to five people evaluate the project. At present I have installed it on everyone's machines. However, when I update my application, I need to go to each machine and update the executable file. There is a central server that can be accessed by all five at my college.
What I want to know is, is there a way where all of them can run the application simultaneously from the central server so that I do not need to run to everyone on campus to update it? I want to update it at the server and be done with it.
Thanks for your help.
There are some possibilities:
Start it directy from the fileshare (negative for network performance and complicated with security)
Write your own updater - you can use the fileshare as source
If your migrating to 2008:
Use WCF Services to send controls to the clients
Your client programm can be small and dumb
And do not use ClickOnce unless you know what it does
http://www.codeproject.com/KB/dotnet/ClickOnceContentExpiratn.aspx