DataSource Controls :: Executing Tasks When A Time Is Reached?
Mar 31, 2010
say you have a table named 'Events' and in there is a list of items such as:
ID = 1
EventName = Staff Meeting
StartTime = 10/04/2010 10:30:00
EndTime = 10/04/2010 11:00:00
---
ID = 2
EventName = Customer Meeting
StartTime = 15/04/2010 13:00:00
EndTime = 15/04/2010 14:00:00
and so on (many more records). Now, whenever a record reaches its' end time, how can I execute SQL commands to delete that data (or mark as finished) and UPDATE another table?
This needs to be running constantly so I was thinking of building it into a Windows Service but can you suggest a better way of doing it?
View 4 Replies
Similar Messages:
Jul 8, 2010
I am in process of developing a registration website for a convention for work. When people register they can choose an activity to do on the convention, however some activites have a maxmium number of people. In my activity table in the database i have the following fields;
RecordID, Name, Limit, Booked, Status
So the record ID is automatic, the name is the name of the activity, limit is the maximum number that activity can hold (20), booked will have the value of the number registered for the activity and status is either open or closed. If closed the activity does not show up for the people to register.
I am not sure how to have an UPDATE query running when the person registers it UPDATES the activity database with the value in BOOKED + 1 and once BOOKED EQUALS LIMIT the status changes to Closed.
View 2 Replies
Sep 15, 2010
I need reliable way to run 10 different tasks simultaneously. For instance the first one would be sending emails, while the next one is cleaning rows from a specific table... so on an so forth.
I've used the Thread class and while it works well on my development machine (VS2010 internal web server) non of these threads seems to be working at all on my production server. And I don't know of an effective way to debug the problem on the production server.
I saw this technique which encourage you to register cache objects. Since the application fires a callback when a cached item expires, then it's possible to run any code to mimic threading behavior. It seems a little Micky Mouse like.
View 3 Replies
May 24, 2010
I have just started to look at the new "System.Threading.Tasks" goodness in .Net 4.0, and would like to know if there is any build in support for limiting the number of concurrent tasks that run at once, or if this should be manually handled.
E.G: If I need to call a calculation method 100 times, is there a way to set up 100 Tasks, but have only 5 execute simultaneously? The answer may just be to create 5 tasks, call Task.WaitAny, and create a new Task as each previous one finishes. I just want to make sure I am not missing a trick if there is a better way to do this.
[code]....
View 5 Replies
Apr 17, 2010
I need to execute the stored proc accross the parameters resulted from select statement
I have created one stored procedure which require one parameters ( username ) ..
i need to execute this SP accross the Select Statement which lists all the username
somethibng like :
Set @username = (Select usename from my table)
EXEC dbo.Duplicate_Data @username
View 7 Replies
Feb 2, 2010
I have an article submission system on my website whereby a user inputs a bunch of information and submits it to the database. After the user presses the "submit" button, apart from submitting the article to the database, I want to also execute another rather large SQL query that inserts additional data into a seperate table.
However since this execution may take a while, I do not want the user to have to wait for the query to be successfully completed before they are forwarded to the "submissionsucess.aspx" page. In other words I would like the larger sql query to take place while the user is still on the website. So I was wondering if there is a way to do the following:
1. User submits article.
2. Simple submit query is executed.
3. Submit query is finished...start complex longer query (takes time).
4. User is forwarded to success page, user then continues to browse website. Complex query still executing at the same time, while user browses website.
5. Complex query is finished.
View 4 Replies
Jan 28, 2010
I have a web project that sends out a customized email after certain user events (like a status change). I also have an SSIS package on the database that pulls in data from one database and updates another database with that data. I want to be able to compare the data and if a particular field's data for that record is different between the two databases is different, I want to be able to use the dll I created for the web app to send the appropriate email.
View 2 Replies
Apr 22, 2010
We have about 500 scripts that we are modifying at development server . These modified scripts have to be run at the live server .
Well instead of running each script, we are thinking of a platform independent application (If we develop in dotnet the user(DBA) has to have dotnet framework installed,hence i am not thinking of a dotnet application) which will execute the script.
(These scripts will be enclosed in a folder and sent to DBA. Through the newly developed application the DBA should be able to browse this folder and on clicking a particular button the scripts placed inside the folder should run.)
Basically such an application should be able to connect to the database and run the scripts that we saved in the folder....
View 4 Replies
Jun 23, 2010
i am having a problem in executing the SSIS package through an asp.net application. i'm using c#. every time i run the package through web, i think the package is not disposed properly so until and unless i stop the application the package won't execute...i am not able to dispose or unload the package. i'm geeting errors like
'WebDev.WebServer.EXE' (Managed): Loaded 'C:WINDOWSassemblyGAC_32CustomMarshalers2.0.0.0__b03f5f7f11d50a3aCustomMarshalers.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. The result of the expression ""EXEC " + @[User::vRowData]" on property "SqlStatementSource" cannot be written to the property.
The expression was evaluated, but cannot be set on the property. : Package Execution results: {0}
here is my code
Application app = new Application(); //Package package = app.LoadPackage("D:ChipRewards_WorkingFolderChipRewardsCodebaseHeathPlanCommonTrunkSSIS PackageETL_WorkFlowETL_WorkFlowDataImport.dtsx", null); //package.ImportConfigurationFile("D:ChipRewards_WorkingFolderChipRewardsCodebaseHeathPlanCommonTrunkSSIS
PackageETL_WorkFlowETL_WorkFlowETLConfig.dtsConfig");
[Code]....
View 1 Replies
Jun 23, 2010
I am having problem in diffrentitate error between internet connection loss error and Other Error in query for example: duplicate record found.
Both the error fall into System.Data.SqlClient.SqlException category.
But the way to handle both this 2 error is different.For connection error , i need to bring user to connection loss page while for duplicate record found error, i need to show the user a pop up.
Unless i do a checking exactly on the error message , else i have no ways to differentiate connection loss error and any other error. Am i correct for this?
View 1 Replies
May 13, 2010
[Code]....
SelectCommand="Execute ClassesSelect" runat="server">
<SelectParameters>
<asp:ControlParameter Type="Boolean" Name="@all" ControlID="chkAll" PropertyName="Checked" />
</SelectParameters>
</asp:SqlDataSource>
View 1 Replies
Mar 2, 2010
I open a sqlconnection and sqlcommand. I execute a stored procedure and get the scope_identity from that procedure to be used within another procedure that needs to be fired. Unfortuntley if the second procedure fails forwhatever reason the data change for the first procedure commits anyway. I kind of want to do a began transaction end transaction on the c#.net side. Also I need to execute a stored procedure multiple times....
View 2 Replies
Mar 23, 2010
when i am executing xmlreader in enterprise library 4.1, iam getting an error like below
error: Invalid command sent to ExecuteXmlReader. The command must return an Xml result.
my code:
SqlDatabase
db = (
cmd = db.GetSqlStringCommand(
xmlReader = db.ExecuteXmlReader(cmd);
db = null;DbCommand cmd =
null;XmlReader xmlReader =
null;SqlDatabase)DatabaseFactory.CreateDatabase();"select
* from emp");DataSet ds = db.ExecuteDataSet(cmd);
View 1 Replies
Aug 31, 2010
I have a webpage with 6 drop down lists. User can start with selecting any drop down list first, and then proceed in any order. 1. Assume when the 1st dropdown is selected first, rest 5 drop downs (except 1st) are filtered/updated based on the selected value in the 1st dropdown.2. Assume user selects the 4th dropdown second, rest 5 drop downs (except 4th) will be filtered/updated but the condition would be based on both 1st drop down and 4th drop down. But while filtering the first drop down, only the 4th drop down is used as filter (self-filter will be ignored).
The code works fine but I see a very bad performance hit in time when the user selects the fourth dropdown after selecting three drop downs. I tried using both SQLDataAdapter and SQLDataReader but neither used to solve the issue. The code takes a lot of time on one line in either of the code (which is highlighted below). When I run the query in SQLServer Mgmt Studio, the query completes in a few seconds.
[Code]....
View 5 Replies
Jun 16, 2010
I have a WCF service that processes some input arguments and retuns result in approximately 4 minutes. Sometimes the calling client may get request time out before the WCF service answers.
Now, my customer is asking me to stop processing on the service side when the client got timed out. Since, I could not know the status of cleint on the service, I could not stop the process.
View 1 Replies
Jan 1, 2010
i need to restore Database.mdf; I create a blank new database exactly the same name as the .mdf file. However, I could not restore the database.
The error message prompted was:
TITLE: Microsoft SQL Server Management Studio Express
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)
ADDITIONAL INFORMATION:
Cannot open backup device 'C:inetpubwwwrootTCPSystemApp_DataDatabase.mdf'. Operating system error 32(error not found).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)
click: [URL]
BUTTONS:
OK
View 10 Replies
Apr 10, 2010
I was wondering if anyone knows of a good login stored procedure that can be freely used and features login limits and so on (basically a good one) With my limited SP knowledge, I've tried to create one myself, I haven't completed it yet as I'm not sure on how to compare the last login attempt time against the current time (it's in the comments).
P.S. I had to write this in notepad.
[Code]....
View 1 Replies
May 11, 2010
I'm trying to set the "time" value stored in a date time field, in other words, I want to change the value
05-13-2010 08.47.34
to
05-13-2010 00.00.00
or
05-13-2010 23.59.59
What statement would I use to accomplish this?
View 4 Replies
Aug 27, 2010
I need two select buttons in my gridview for two different tasks and I'd like to change color of selected row.If I use command field selected row changes color, but I don't know how to distinguish which button has been chosen.If I use linkbutton I can pass commandname but selected row doesn't change color
<asp:GridView ID="gv" runat="server" ...
AutoGenerateColumns="false"
AutoGenerateEditButton="false" AutoGenerateDeleteButton="false" AutoGenerateSelectButton="false"
OnRowCommand="gv_RowCommand"
[code]...
View 2 Replies
May 6, 2010
The SQL below takes at least 7 second to run and may even time out.
There are a lot of records over a million in each of the two tables being inner joined and then being searched on.
I have tried putting an index on the create_date# and rdat# hoping that sql would not have to access all the records
But it seems to have made no difference, so I have now deleted those indexes.
I realise that manipulation of strings comes at a price but I can only work with the data I have been given.
Do you have any tips or trick that I can use to optimise this code?
-- Description: Finds all customer infomation that matches at least two params
-- =============================================
ALTER PROCEDURE [dbo].[usp_FindMatchesInDAProspect.bak] [code]....
View 1 Replies
Jan 29, 2010
I am trying to compare a datetime in a SQL 2005 database (using the DateTime datatype) with the current datetime to determine if a database update should run.This is the page load sub
[Code]....
The problem I am having is that when the datetime is pulled out of the SQL database it doesn't seem to know whether the time was in AM or PM and the datetime is being saved in a 12 hour format, not 24 hour.As you can see from above if there has not been an update in more than 4 hours it opens a popup. The problem is, if the update happened at 6am and it is now 7pm the page only detects that as 1 hour not 13
View 2 Replies
May 10, 2010
i create a stored procedure that would out the following time format
09 hr(s): 30 min(s)
but i want to convert it to a decimal. (eg 9.50)
I was trying this method:
ALTER procedure [dbo].[timetodecimal] @hms varchar(8)
View 7 Replies
Jun 21, 2010
When I attempt to store the current time of 'DateTime.Now' in a column defined as time in a table within an SQL database, I get an error message that says: Cannot implicitly convert type 'System.DateTime' to 'System.Timespan'.
I have no trouble storing the current date of 'DateTime.Today' in a column defined as date, but this column will not also store time along with the date. The date column has properties that indicate it has a data and system type of date with a Length of 3 and a Numeric Precision of 10. The time column has properties that indicate it has a data and system type of time with a Length of 5, a Numeric Precision of 16 and a scale of 7. Did I define the time column incorrectly for storing the time of day?
View 9 Replies
Jun 15, 2010
For example, I have a table with a schema
[code]....
Thus, rejecting all the duplicate times within 01 Minute period for that specific employee.
View 7 Replies
Jan 15, 2010
Iam confronted with a really weird issue the like of which ive never seen before. I recently developed a web application using ASP.net and launched it for my company, during the bug testing stages everything seemed fine, but once it was actually in production i started getting these weird errors that all stem from it not retrieving the correct rows.
The issue is this, sometimes the queries sent to the back end only return a partial amount of the rows actualyl requested, so if a user has a page loaded thats suppose to return X number of rows, they can sometimes get X - Y number of rows, and upon refreshing the page they get X - Z number of rows, and refreshing the same exact page again they might get X number of rows they were initially suppose to see. I've never seen anything like this before so Iam stumped.
I consulted some of the old developers in the company I used to work for, for assistance but when explaining and showing the problem they too were very confused with the issue.
View 10 Replies