DataSource Controls :: Executing SQL Query In Background?

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


Similar Messages:

DataSource Controls :: Internet Connection Loss While Executing Query?

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

DataSource Controls :: Executing The SP Across Select Statement?

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

DataSource Controls :: Executing Code In SSIS?

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

DataSource Controls :: Executing Multiple Scripts At Once?

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

DataSource Controls :: Executing SSIS Package Through Asp C# Application

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

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

C# - Nhibernate - Getting Exception Executing SQL Query?

Apr 20, 2010

I am excuting SQL Query using Nhibernate, here is my code

public ArrayList getDocumentsForApproval(string ReleaseId)
{
string query = string.Format("SELECT distinct doc.Id, doc.Name as Doc, doc.url as url, suser.Name as Author, ds.name, CONVERT(VARCHAR(11), doc.DateEntered, 101) as DateEntered FROM dbo.Documents doc INNER JOIN DevelopmentSteps ds ON doc.TypeId = ds.Id INNER JOIN DocumentTrackingItems dti ON doc.Id = dti.DocumentId INNER JOIN TrackingItems ti ON dti.ItemStepId = ti.Id INNER JOIN dbo.Releases rl ON ti.ReleaseId = rl.BugTrackerName left outer join (select * from users) as suser on doc.AuthorUserid = suser.Id WHERE doc.DateEntered IS NOT NULL AND doc.DateApproved IS NULL AND rl.ID = '{0}'", ReleaseId);
ISession session = NHibernateHelper.GetCurrentSession();
ArrayList document =(ArrayList) session.CreateSQLQuery(query).List();
return document;
}

Exception Details:

NHibernate.QueryException: Return types of SQL query were not specified [SELECT distinct doc.Id, doc.Name as Doc, doc.url as url, suser.Name as Author, ds.name, CONVERT(VARCHAR(11), doc.DateEntered, 101)

View 1 Replies

Forms Data Controls :: Executing A Stored Procedure Using A SQL Datasource?

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

DataSource Controls :: Executing Two Stored Procedures That Either Pass Together Or Fail Together?

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

DataSource Controls :: Invalid Command Sent To ExecuteXmlReader Error While Executing Xmlreader?

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

Executing A SQL File Or Query Via A Submit Button?

Jan 28, 2010

I'm trying to figure how to on a submit button execute an sql file.

We have a job recruiting application, and for the subsidiaries companies they all have their own database setup for the jobs. At night the application has a consolidator script built in to pull all the jobs posted in those companies and load the posting into the parent companies website job listing. This listing will then point back to the Subsidiary website for the applicant to apply.

The issue with that script is the time it took to execute which is 20hrs to run as a scheduled task. We have created a more efficient script and would like to place a submit button in the admin panel for the HR recruiters to click which will automatically upload their updated job listings to the parent company.

So what would be the proper coding framework to use on the submit form to execute our new consolidator sql script?

View 3 Replies

SQL Server :: Not Identifying Quote When Executing Query?

Sep 30, 2010

Im using SQL Server 2008 R2, Server version 9.0 SP3Im trying to do a replace on a comma seperated values before submitting to the "IN" condition.

[Code]....

[Code]....

View 2 Replies

DataSource Controls :: SqlDataSource And Parameters Query / Trying To Accomplish Is Building Dynamic Query

Aug 22, 2010

1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like

SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.

Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).

2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query

(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).

If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.

View 11 Replies

DataSource Controls :: Update Query Not Working When Using Query Builder To Configure Table Adapter

Jan 15, 2010

[code]...

This query works perfectly on the query analyser.

But when configuring the Table adapter ,I try executing the query and i get 0 rows affected.

What could I be getting wrong in this case.

NB:Existing GalleryID has been supplied.

View 1 Replies

DataSource Controls :: Can't Find Query's / By Right Clicking On Database Created A Query In Server Explorer?

May 17, 2010

By right clicking on my database i created a query in server explorer. But where are this query stored can't find them back. I should aspect that their is a folder query's like there is a folder tables but this isn't the case.

View 10 Replies

ADO.NET :: [Entity Framework] Strange Error Executing A Sql Query

Nov 29, 2010

I have a strange error, I've tried to search for it before writing this post but I wasn't able to find out a solution yet.

I'm executing a query using ExecuteStoreQuery against a MySQL database, but it throws an exception reporting that there's a syntax error in my SQL.

I've tried to copy&paste the sql query into the MySQL tool and it works nicely, giving the correct results.

I've tried to open manually the connection and using CreateCommand to use it the "old way".

My query is a bit long, 4000 chars more or less, could it be the problem?

View 4 Replies

SQL Server :: DataAdapter/SQLDataReader Takes Lot Of Time For Executing A Query?

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

DataSource Controls :: How To Convert Sql Query Into Linq Query

Mar 10, 2010

select Groupid,GroupName,onorusername from palgroup where groupid in (select distinct Groupid

View 5 Replies

DataSource Controls :: Accessing FK From A Query Via Entity Query

Jan 21, 2010

I've got a query such as

Dim MediaQuery =
From m
In dB.DOWNLOADS _Where m.ID = id _Select

which returns a record from the database. One of the fields in the record is a FK to another table. I need to read this value to be able to set a dropdown based on the ID but I can't work out how to access it. For a standard record I can just do the following txtTitle.Text = MediaQuery.FirstOrDefault().TITLE

However with the foreign key it doesn't work like that. I've tried drpGroup.SelectedIndex = MediaQuery.FirstOrDefault().DOWNLOAD_GROUPS.ID where DOWNLOAD_GROUPS is the FK field but it returns Object reference not set to an instance of an object. If you're simply wanting to read some values from a single db record in the entitiy framework and one is a foreign key how should I go about getting the value?

View 2 Replies

DataSource Controls :: Getting Exception / An Exception Occurred While Executing A Transact-SQL Statement Or Batch

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

DataSource Controls :: Not Able To Run SQL Query Using If Else?

Apr 21, 2010

I am using Querystring "ddl4" to pass on value of a drop down list to the next page where I am using that value in the WHERE clause of a SQL command. I also need to check whether ddl4 is blank or not which I do using If Else in SQL command. I am not able to run the query where the Querystring ddl4 IS NULL

This is the sample link with the Querystring ddl4 carrying a blank value:

[code]....

View 2 Replies

DataSource Controls :: How To Run Sql Query From Project

Apr 13, 2010

I have one query in my project (saved in folder SQLQueryes, Query.sql) and i need to execute it. Also, i have one parameter in script and i need to include him also. How?

View 8 Replies

DataSource Controls :: SQL Query With IF And Select

Feb 18, 2010

SQL Query with IF and Select

View 2 Replies

DataSource Controls :: Why We Need Union Query

Jun 10, 2010

if there is no relation bettwenn two tables why do i need union for example like below Please
can u inform me

SELECT categoryId
FROM categories
UNION
SELECT shipperId
FROM shippers

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved