Automate The Running Of A SQL Query?
Mar 16, 2011
What should i research in order to accomplish this task?
I am using MS-SQL & VB.Net
I have a SQL table that stores startdate and enddate. I want to run a query on that table every 10 minutes in order to check if the enddate is greater than today and if it is I would like to add a 1 to another column if it is not I would like to add a 0.
View 3 Replies
Similar Messages:
Aug 18, 2010
i have a upload control that alllows users to upload files to the server. and a drop down list that shows the contents of the files in the folder.
And a button labeled execute.
The .txt i need them to upload will give insert queries that the server needs to run upon clicking the execute button.
View 4 Replies
Jun 25, 2010
I've been having an issue with running an SQL select statement with a button. At the moment, my page has two buttons and allows both to run the gridview where my SQL data displays. In my asp page I have:
<asp:Button ID="btnGo1" Text="Search" runat="server" onClick="btnGo1_Click" />
In the C# code, I have methods for OnLoad and btnGo1_Click, but I'm pretty new to programming and don't know how to link the methods to the button I created.
View 2 Replies
Mar 19, 2011
The below SQL query is running extremely slow. Im using this query on other tables and its processing about 5 rows per second. The below version is running 1 row every 10 seconds when @SQLNew is executed.
[Code]....
View 5 Replies
Mar 4, 2010
When doing a query e.g. "select ID from myTable order By SomeStringField" from SQL Developer my data the data are sorted correctly according to database settings:
Abc
abc
Bcd
bcd
But when using the System.Data.OracleClient namespace and a DbProviderFactory to create a DbCommand and use that to create a DbDataReader, the data is sorted case sensitive:
Abc
Bcd
abc
bcd
Is there some setting on the command which needs to be set? Can you even change the case sensitivity in the .net framwork, overriding the database settings?
View 3 Replies
Jul 6, 2010
I have a datasource (which is a query) that could run more than 30 secs. I want to show to a user an animated icon (I have it already) while the Gridview is waiting to return data.
I studied several tutorials and textbooks but all just "thoerectically" use a timer to simulate, without much application to real example above. How should I code it in the above real scenario ? In which event handler to put the code and what control (Update panel) to use and any sample code ?
View 6 Replies
Feb 11, 2011
I want to start a new thread to query a database while my web application continues running. I was under the impression that by using threads I can run the querying process independently while the normal web application page cycle carries on, but I could be wrong.
public class DbAsyncQuery
{
Dictionary<string, object> serviceResults = new Dictionary<string, object>();
public void UpdateBillingDB()
{
QueryAllServices();
foreach (KeyValuePair<string, object> p in serviceResults)
{
IEnumerable results = (IEnumerable)p.Value;
IEnumerable<object> sessions = results.Cast<object>();
DbUtil.MakeBillingDBEntry(sessions, p.Key);
}
}
public static string[] servicesToQuery = new string[] // Must go in config file ultimately
{
"xxx.x.xxx.xx"
};
public delegate void Worker();
private Thread worker;
public void InitializeThread(Worker wrk)
{
worker = new Thread(new ThreadStart(wrk));
worker.Start();
}
public void InitializeQuery()
{
Worker worker = QueryAllServices;
InitializeThread(worker);
}
private void QueryAllServices()
{
Dictionary<string, DateTime> lastEntries = DbUtil.GetLastEntries();
foreach (string ip in servicesToQuery)
{
string fullServicePath =
"http://" + ip + ":800/MyWebService.asmx";
//object[] lastEntry = new object[] { lastEntries[ip] };
object[] lastEntry = new object[] { new DateTime(2011, 1, 1, 0, 0, 0) };
object obj = WebServiceHandler.CallWebService
(fullServicePath, "MyWebService", "GetBillingDBEntries", lastEntry);
serviceResults.Add(ip, obj);
}
}
}
It seems to basically stall and wait to finish the query before loading the page (which can be thousands of rows, so it takes awhile). I put this in the following section of Global.asax:
protected void Application_Start(object sender, EventArgs e)
{
DbAsyncQuery query = new DbAsyncQuery();
query.UpdateBillingDB();
}
This is one of my first web pages, and I'm new to threading. I understand there is a difference between creating your own thread and using the ThreadPool. In this method, I am using my own thread, I think. Not sure if that's the best way. The querying process can be completely independent, and its only going to occur on scheduled intervals (every 8 hours or so). The user doesn't need to have up to the minute data, so it can take awhile. I just don't want the site to wait for it to finish, if that's possible.
View 1 Replies
Jun 29, 2010
I have one query which is not responding even after 4 minutes. But same query is when called from asp.net pages (though stored procedure), responds within 10 seconds. My Query:
[Code]....
I don't want to know the ways to optimize the query as I have already changed the query and now it responds within fraction of second. I just want to know that, why it was not reponding after 4 minutes in SQL Management Studio and responds in just 10 seconds when run from asp.net through stored procedure. I am using SQL 2008 Express with Advanced services and .NET 3.5.
View 4 Replies
Jan 25, 2010
I have a query which is returning records like below which returns a list of tasks with a corresponding task type. there is a task table (wh_task) and a task type table (wh_task_type). What i want to achieve is a count of all the tickets per ticket type. So at the end of the query i will have a total for Administration / Maintenance tasks (1) and a total for Routine Maintenance Tasks (3). ** and all the other types *
There are many different types of task type so I dont want to have to hard code it. Can count all the occurencies of the different ticket types.
Task Name
Task Type
Date Completed
SBS Server C drive running out of space
Administration / Maintenance
16/07/2007 16:03:34
Patching Server(s).
Routine Maintenance
08/01/2009 06:51:56
Patching Server(s).
Routine Maintenance
11/02/2009 10:06:06
Patching Server(s).
Routine Maintenance
04/05/2009 06:53:24
I can also get wh_task_type_id.
Here is my SQL:
[Code]....
View 8 Replies
Oct 21, 2010
I am running a sql script which Inserts 500 rows and after each insert, it calls a stored procedure which diplays result in the results window. So after executing 100 rows, it throws an error that maximum number od results in the results pane has reached its limit but the query executes successfully. How can we disable the stored proc output to not display in the results pane. I do not have access to the stored procedure.
View 4 Replies
Nov 15, 2010
One of my peer wrote a query based on multiple tables using joins. One of the table is in a different database The query was taking much time
1. Create an SP
2. Create a temp table and copy all records from the external db
3. Avoid using Left Join as much as possible and use Inner Join
4. Create and use indexes
5. Remove tables/columns that are not necessary
In this scenario, I would like to suggest to use Covering Index, but how can it be created for multiple tables and a temp table?
View 3 Replies
Jun 24, 2010
I have a web service that runs a query (from C#) to get a dataset from sql server. I get the following time out error. Googling on this error says, you can set the timeout on command object. But I am not using command object to set the timeout. This is the code I am using to get the dataset.
code:
[code]....
View 8 Replies
Jun 21, 2010
I have an asp shopping cart and when purchased I want to automatically send the user their login ID and pwd using ASP/VB.
View 12 Replies
Jul 6, 2010
i'm trying to integrate Paypal in an asp.net app. It works fine, the last thing i would like to do is to automize payment notify.
In particular, how does it works IPN ? I would like to set a field to 1 when a user buy a service... How can i do with ipn ?
I'm asking here to avoid to read all 120 pages of paypal IPN documentation... ;)
View 1 Replies
Mar 30, 2010
I am developing the online bidding system using asp.net where I need to close the auction if the auction time is get closed without any bid.
As in the following web site :
{URL}Please help me to resolve to this problem.
View 1 Replies
Jun 18, 2010
Does anyone know how i can automate the process of publishing a webapplication.Normally in Visual studio i go to Build | publish and fill in the data.However i want to do this using c# , so that the process can be completely automated.I tried it using the Microsoft.Build.Engine. But i did not succeed
View 2 Replies
Mar 30, 2010
I am developing the online bidding system using asp.net where I need to close the auction if the auction time is get closed without any bid.
As in the following web site : [URL]
View 1 Replies
Aug 12, 2010
I have a gridview on my page. I want the page to show me next 10 records after every 10 seconds. i.e. automated paging.I have implemented manual paging on Gridview. How can I do this using Client Side event triggering
View 1 Replies
Jul 20, 2010
I have an aspx page that executes an HTTP posting of XML documents to a customer's server. Currently have a few textboxes and a button on the page and the procedure is executed when the button is clicked.
I need this process to happen automatically when the XML document created but I don't know how to integrate the use of a FileSystemWatcher control in a web page. How do I instantiate the FSW? To run automatically web page should never be opened manually.
I tried setting it up as a web service, but again, couldn't figure out how to instantiate the process. Can this be done with some kind of custom handler?
View 3 Replies
May 20, 2010
Asp.net web application (source stored in svn) sqlserver database. (Database schema (tables/sprocs) stored in svn) db version is synced with web application assembly version. (stored in table 'CurrentVersion')CI hudson server that checks out web app from repo and runs custom msbuild file to publish/package app.
My msbuild script updates the assembly version of the web app (Major.Minor.Revision.Build) on each build. The 'Revision' is set to the currently checked out svn revision and the 'Build' to the hudson build number (incremented on each automated build).
This way i can match the app to a specific trunk revision also get other build stats from the hudson build number.
I'd like to automate the collecting of migration scripts (updated sprocs etc) to add to the zip package. I guess by comparing the svn revision of the db that has yet to be deployed to, to the revision being deployed, i can find what db files have changed in the trunk since the last deployment to that database/environment.
This could easily be achieved by manually calling the svn diff -r REVNO:REVNO command to list changed .sql files. These files could then manually have to be added to the package.
It would be great if this could be automated.
Firstly i'd imagine I'll have to write a custom task to check the version of the db that has yet to be deployed to. After that I'm quite unsure. how this would be achieved through an msbuild task either existing or custom?
Finally I'll have to autogen a script to add to the package that updates the database version table so as to be in sync with the application.
View 3 Replies
Jan 14, 2011
I've been tasked with building a screen scraping application, and I'm looking for information on the best way to cope with web pages that would normally require user input and interaction.
Can this be done via standard web / javascript coding. Is there any API that would allow a desktop application to achieve the same effect?
View 3 Replies
Nov 26, 2010
Which of the following answer is true and why?
Question: Which type of .Net application can be used to automate tasks and does not require a user to login?
a. Windows Form
b. Windows service
c. XML Web Service
d. Net remoting object
View 1 Replies
Oct 8, 2010
We want to automate the DCOM Config - Permission settings for MS Office packages. This we need to be done through by C#.net. Is there any possible way to do this?Clarifications needed:
Instead to do manual settings by automation is there any possible to do by
Component Services->Computers->My Computer->DCOM Config Any C# or relevant Codes or Scripts available t o automate these Component Services->Computers->My Computer->DCOM Config - (relevant MS Office packages)
View 3 Replies
Jun 4, 2010
How can I automate a Stored Procedure, without using SQL Jobs, on a SQL Server Express 2005?
View 2 Replies
Jun 10, 2010
I had some requirement, in which i need to automate a report genration automatically on a prescribed time of the day. I had the done with the report generation part in a aspx page. But i need to the ping of the page automatically to genrate the report.
View 2 Replies