I have a task that basically I don't know how to accomplish it and I want some advice from you guys : I have a database that contains many binary images and a website that has a button.
When I press it a select statement is executed to search all the newly inserted rows after a specific date and send it to the website to process. My boss asked me if there is any way I can do that process manually by using a web service or anything else like a trigger in the database that automatically searches for new rows after a specific date and sends the new rows to the web site.
I don't know if I explained what I need. My main question is it possible to do this and what is the best way to achieve it. one more thing if it is achievable can I trigger it to work every day at a specific time ? Thank you
As I understood you question, these are the requirements:
You need to automate the process that is now manually triggered by clicking the button on the web page
The simplest way to do this in my opinion would be to create a small Console application and install it on a suitable server. Then on the server create a Windows task scheduler (Google it unless you're already familiar with it) task that runs the console application on a suitable schedule.
You could for instance have it run once every night at say 10 minutes past midnight and it would fetch all images from the past day and "send them to be processed".
First of all you have to understand website is not a repository of records but it works based on user requests. So in your website if you want to change contents on web pages, try AJAX reqeusts. If you are looking for some options to update details in other systems periodically think of eitehr Windows services, or cron jobs or may be SSIS jobs etc.
Use Cursor and Trigger but u have to store date in database which u want display on particular date
Related
I need to create a background app like a 'job' that runs everyday in a specific directory. This job have to pick up a bunch of PDF forms that have been filled (all those forms are purchase orders) and extract then insert those data into a purchase orders Microsoft SQL database.
I know that Excel as a pretty good import feature for this situation but I need it to be automatic and more like a "Service" which really runs in background.
I've been looking for ideas on how to approach the problem and I did not find much so, if you guys have any ideas I would love to hear about them.
Edit : I think a good solution would be a powershell script which does it all, loop, import, insert.
Thank you in advance.
You can use a C# Console Application for that. Write a console app that extracts data from Excel/PDF then writes it directly to MsSQL database. Then trigger it with Scheduled Tasks on windows.
I've put a public survey form online through https://forms.office.com/ (Office 365)
Is there some way or API I could use to download the results spreadsheet using .NET?
I'm sorry if the question seems silly, but I couldn't find an answer in my research.
Unfortunately an API has been promised for Forms for a long time but has never arrived.
One way is to use a flow in Power Automate to save each form response to a list in SharePoint. You can either see the last week's responses there or you could have another flow with a recurrence schedule trigger set to 1 week. That would get the items created in the list in the last week and do whatever you want to do with it.
or the other way is.
You must first open the URL “https://forms.office.com/Pages/DesignPage.aspx” to obtain a token
Then you can call "https://forms.office.com/formapi/DownloadExcelFile.ashx?formid=" + put your form ID Here + "&timezoneOffset=180&minResponseId=1&maxResponseId=1000"
Im trying to do something similar to the Scheduling of posts for Facebook pages... on ASP.net/c#
So basically what i need is :
User fills a few text boxes
Selects a date...
The post gets posted on that date...
I am unable to really understand the logic as well as coding for this...
What i have thought so far is, once the user submits the post, store the details in a table in SQL like SheduledPosts, and when the CurrentDate(Server Date) matches the date....
Transfer the SQL entry from there to the actual PostTable.
Now the actual process needs to take place without any pages loading or any actions done by the user... So I also dont understand how to make it happen from the server side...
Please note that im not trying to post anything to facebook... rather, trying to do a schedule form submitting on my own asp.net website...
Any help regarding the logic, coding, scheduling will be greatly appriciated...
Thank You
I can think of a couple of different ways to accomplish this:
Implement a "pending posts" table and have a separate process running on the server to take care of transferring the post from the "pending posts" table to the "current posts" table at the appropriate time.
Add a "publish_on" datetime field to your current posts table, and when selecting items to be displayed in the page output, add a "WHERE publish_on IS NULL OR publish_on > GETDATE()" clause to your query. You fill this in for posts you don't want going live until a particular time.
Personally, I would go with the second approach, since I think it's a more elegant solution.
You can do this with one table. Just have a 'Submitted' date field (for your records), a 'Publish' date field and a Boolean 'Published' field. Create a Windows Service to run every 5 minutes or so and let the service perform the date check; when it finds one that satisfies the date criteria, it just toggles the Boolean field to 'true' and your page logic can then display the post.
Here is a walk-through on creating a simple Windows Service:
https://msdn.microsoft.com/en-us/library/zt39148a%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
I am building a website Asp.Net/C# and one component has a schedule with the AJAX Calendar Extender that puts the selected date in a text box, of course. I also have an AJAX Time Picker pick a time in another box.
However, I'm feeling a little ambitious; I want it where if someone selects say... July 25th, 2014, at like 1:30 PM, I want it to throw back a message on selection that the block of time is already selected. The time intervals run every 15 mins apart (i.e., 1:00, 1:15, 1:30, and 1:45).
I'm thinking I need a database behind the site to hold this, maybe SQL Server or would a lightweight Access workup due? My though is that it will hit the database and check for a duplicate instance of the select date and time slot, chosen by the user - then report back if it gets a hit... otherwise, it will populate the date and time text fields in the form.
It's for a small yard service company that makes out calls, but I wanna test and push myself. Any advice and structure suggestions from some seasoned pros who would be greatly appreciated. Thanks. Let me know if I need to provide more details.
If you do not have a database holding the data, where will you store the booked time slot? Where you plan to store your login information like user acc/password.
Of course you can store into text file but I would suggest a light DB like access. It would be enough for you to store few tables with not many line of data.
I do not see any problem with your taught to verify the data again what you stored in db. It should be the way.
I need to reset the value of a specific column in a table to some specific value per month.
eg: allowances column should be reset to 10,000 at the beginning of each month.
(using sql-server and asp.net)
How to achieve such kind of a task ?
Create a service, which will check your record once per day and reset it when needed
On user logon, check and reset
On Application start, check and reset. Also, a static class with timer, which will run the code at certain intervals
Ideally you would have a process that would check date couple times per day (just to make sure) and update the data.
Problem is that you can’t create processes that are running in the background using only ASP.NET – you need a windows service that would be hosted on the server in order to achieve this.
Here are several other options you can try.
Modify Session_Start method in Globl.asax to check date and modify data – this will make it so that first visitor who accesses application on the first day of the month triggers database reset.
Create a separate page that, when accessed, checks date and resets the data and then find some online service that can ping this page like once per day or on a given day of the month….
You can use Sql server integration services project and schrdule it as a batch job to run it every month,
inside the job you can use sql task to update the value