I need to set my asp.net application variable to today's date so it can check when a last database refresh was done. I have data coming from one view into a table used by my application so I need to insert or update based on if data exists or not.
Basically I just need the update to run once a day so the variable just needs to check to see if it was run each day. So every time the application loads, if the refresh was run today don't run again if so run??
I'm pretty new to this so any help would be appreciated.
2 1138
Why did u prefer to use application variable for this requirement. If a update has already done on that date, use a flag and date column in the DB itself for your check. If the flag is set then show a message to the user by check that date with today's date.
I'm new to all this just learning. I talked to a few other developers here and both using a column and flag and application variable came up. When my boss wrote down what to do he said to start with setting the application variable to date(today). Then write the sp. Right now i'm sort of confused about the best way to accomplish this.
I don't know how to use a flag. The inherited sp currently looks like this. I say inherited because I took an application another dept uses to modify it to our needs. They are using a view to insert new employees, we will be checking whether an employee personnel # exists, if so then update if not then insert. I am trying to figure out their logic, apply our logic and learn what i'm doing at the same time =) - -- insert newly found employees
-
INSERT INTO dbo.employee
-
(NTusername, full_name, cost_center, location, job_title, supervisor )
-
SELECT empUserName, full_name, cdcstcntr, cdlocation, job_title, supervisor_name
-
FROM dbo.v_wqtimenewemployees
-
-
-- update fields in the employee table
-
UPDATE dbo.employee
-
SET full_name = t.full_name, cost_center = t.cdcstcntr,
-
cost_center_desc=t.desccstcntr, job_title=t.job_title,
-
supervisor=t.supervisor_name
-
FROM dbo.v_WQTimeEmployees as t RIGHT OUTER JOIN
-
dbo.employee ON t.empUserName = dbo.employee.NTUsername
-
WHERE t.empUserName = dbo.employee.NTUsername
-
AND (dbo.employee.manual IS NULL or dbo.employee.manual=0)
-
-
-- update location if it is set for automatic updates
-
UPDATE dbo.employee
-
SET location=t.cdlocation
-
FROM dbo.v_WQTimeEmployees as t RIGHT OUTER JOIN
-
dbo.employee ON t.empUserName = dbo.employee.NTUsername
-
WHERE t.empUserName = dbo.employee.NTUsername
-
AND (dbo.employee.manual_loc IS NULL or dbo.employee.manual_loc=0)
-
-
-- archive those no longer in wqtime
-
UPDATE dbo.employee
-
SET inactive = '1'
-
FROM dbo.v_WQTimeEmployees RIGHT OUTER JOIN
-
dbo.employee ON dbo.v_WQTimeEmployees.empUserName
-
= dbo.employee.NTUsername
-
WHERE (dbo.v_WQTimeEmployees.empUserName IS NULL)
-
AND (dbo.employee.manual IS NULL or dbo.employee.manual=0)
-
AND (dbo.employee.inactive is null or dbo.employee.inactive=0)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: aa |
last post by:
I am migrating to PHP from ASP where there are the Application Scope variables which are accessible from any page on a website and which are used, in particular, for hit counters.
Is there a similar mechanism in PHP?
|
by: Mark Fisher |
last post by:
I have a Java desktop GUI application that the user can run multiple
times. In order to keep one instance of the application distinct from
another, I'd like to put the instance number of the application in the
title bar.
For example, the user starts the application, and the title bar says
"Control Panel". The user starts another instance of the application,
and it knows that one instance is already running, so the title bar of
the...
|
by: Duncan Welch |
last post by:
Good morning,
I have a classic ASP app that I'm converting to .NET. In the existing app
when accessing infrequntly changed data, it reads a database once a day, and
saves the results in an application variable.
I'm trying to replicate this in .NET, but I'm using a data access layer
(DAL) that's in a seperate project. Obviously, the DAL can't see the
application variables. I was thinking of passing the application state in
the...
|
by: Patrick |
last post by:
Hi
I have the following problem. When starting my asp.net application, i read a
encrypted string from a file, decrypt it and want this values to be
available in the complete application. they should be stored in a global
variable, but it shouldn't be possible to modify this variable.
so what i tried first was using the application object to store that string.
that was fine, but the problem is, that it can be modified from outside, so...
|
by: Keith Chadwick |
last post by:
I am having some trouble referencing an Application("myVar") variable from within a module.vb file on my ASP.NET site.
According to the documentation I should be able to reference System.Web.HttpApplication but it does not seem to like that one bit.
I also have a MSXML2.DOMDocument30 defined as a public object within the vb module which is loaded during the application start up with a bunch of XML. What is weird is that the data contained...
| |
by: William LaMartin |
last post by:
I have a problem, mentioned here before, of Session and Application
variables disappearing at one site but not at others or on my development
computer.
The problem is illustrated by an example at
http://www.lamartin.com/dotnet/sessiontestset.aspx, were I set Session,
Application and Cache variables on the first page and then on the second
page view them as the second page is refreshed every five seconds. Before
10 refreshes, the...
|
by: Greg Collins [MVP] |
last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions.
What I've got is a decodeImage.aspx page that gets called to decode base64 encoded images and return them as displayable images to a Web page. The ASPX page is passed two parameters, "file" and "img". The "file" parameter specifies and XML file on the Web...
|
by: J-T |
last post by:
We are working on an asp.net application which is a 3-tier application.I was
aksed to create a component which monitors a folder and gets the file and
pass them to a class library in our business logic layer(so far so good and
easy).I initialize my class which is using a FileSystemWatcher in my
Global.asax and everything works fine.I have found FileSystemWatcher class
not very reliable and sometimes it behavies unexpectedly.I'm afriad that...
|
by: Frank_00001 |
last post by:
I've migrated an application from VS 2003 to VS 2005. It worked fine in
2003; but I've been having issue in 2005. The latest is dealing with a
DataSet that I have as an Application Variable. It seems to disappear when
the users session times out. What really weird is that it works fine on my
development box; but flakes out on the server. I added a button to a dummy
webpage to reload the Application variable; but it still disappears...
|
by: Victor |
last post by:
I've got two domain names sharing the same IP address that use ASP VBScript
If I set a session variable with domain 1, it is only available for domain 1 - this is
correct?
If I set an application variable with domain 1, the app variable is sharing across all
domains using that IP address - this is correct?
This is the behavior I am seeing and I want to make sure that my server is set up
correct. I especially want to make sure...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |