WCF - How To Execute Server.Execute Asynchronously

Mar 30, 2010

I need to run the HttpContext.Current.Server.Execute method in my ASP.NET application. This application has a WCF operation that does some processing. Currently, I am to do my processing correctly from within my WCF operation. However, I would like to do this asynchronously.

In an error to attempt this asynchronously, I tried running Server.Execute in the DoWork event handler of a BackgroundWorker. Unfortunately, this throws an error that says

"object reference not set to an instance of an object" The HttpContext element is not null. I checked that. It is some property nested in the HttpContext object that appears to be null. However, I have not been able to identify why this won't work. It happens as soon as I move the processing to the BackgroundWorker thread.
My question is, how can I asynchronously execute the Server.Execute method?

View 1 Replies


Similar Messages:

Architecture :: WCF Integration - Running Server.Execute Asynchronously?

Mar 30, 2010

I need to run the HttpContext.Current.Server.Execute method in my ASP.NET application. This application has a WCF operation that does some processing. Currently, I am running a Server.Execute call from within my WCF operation and getting the results I would expect. However, I would like to do this asynchronously.This is where my problem comes in. In an error to run Server.Execute asynchronously, I tried running Server.Execute in the DoWork event handler of a BackgroundWorker. Unfortunately, this throws an error that says

"object reference not set to an instance of an object"

The HttpContext element is not null. I checked that. It is some property nested in the HttpContext object that appears to be null. However, I have not been able to identify why this won't work. It happens as soon as I move the processing to the BackgroundWorker thread. My question is, how can I asynchronously execute the Server.Execute method? Are there options beyond BackgroundWorker that will work?

View 2 Replies

How To Execute Web Services Asynchronously In Server Side When Called By JQuery's .ajax

Mar 22, 2011

I have an ASP.NET (3.5) web page which calls a few web methods (SOAP based) using jQuery's .ajax method. The web methods implement 'ScriptMethod' attribute and return JSON data. The web service file (asmx) is local to the same project.

I noticed these web methods execute synchronously on the server which means they run sequentially and affect performance negatively, some methods are waiting, when some of them are slow.

I read this article and I am not sure if I understand that WebMethods which implement Scriptmethod can run synchronously only (they implement IHttpHandler not IHttpAsyncHandler).

If this is true, I might have to change the design. I am looking for other designs, maybe like using WCF, where the browser can call webmethods using JavaScript and the web methods run asynchronously on the server.

View 2 Replies

C# - MVC Execute Asynchronously?

Mar 20, 2011

Is there a way to make a controller return something to the user first then execute another method? I have a process that is very time consuming. I'd like to send back a quick JSON response to the user then process.

View 2 Replies

SQL Server :: Stored Procedure - EXECUTE And EXECUTE Sp_executesql

Mar 10, 2011

I am looking through a sql stored procedure which I might need to update in the near future. Basically the stored procedure is about 20 lines long. The stored procedure first builds a query

and stores it in a variable named "@Sql". And then for the last two lines of the stored procedure it appears that the big sql statement stored in "@Sql" is executed by using the "EXEC" command. See below. What is confusing though is that the query appears to be exectuted twice? Why was the query written in this way. Don't both lines do the same thing? Why is it being done twice? Could this possibly be a mistake on the
part of the person who wrote the query. Below are the two lines I am talking about?

EXEC sp_executesql @sql
EXEC (@sql)

View 4 Replies

Webforms - How To Execute A Page Asynchronously

May 19, 2010

how to execute a asp.net page asynchronously?

So I am displaying a page to the user, but when an event happen, I need to execute another page, without using ajax, but using C# code.

I am using asp.net webforms.

View 3 Replies

C# - Execute SSIS Or DTS Package Asynchronously?

Aug 12, 2010

I need to load and execute SSIS or DTS packages ASYNCHRONOUSLY from ASP.NET C# page on click of a button and report the success or failure at the end of the execution and if it fails the details of the exception should be shown to the user. it needs to be asynchronous because job could take a long time to finish. user should also be able to cancel the execution of the package while it is running if he wishes to do so. there is also requirement to execute multiple packages in parallel and track the progress for each of them. is this possible to achieve OR too complicated to do it from ASP.NET?

View 4 Replies

AJAX :: Execute Animation On An Asp Button That Has To Execute Code On Postback?

Feb 15, 2011

I'm trying to understand how to execute AJAX animation on an asp button that has to execute code on Postback. In other words, I have button with code behind that needs to be excuted, but at the same time want to be able to have one of animation extenders be applied to it. I understand that I need to use the BeginRequest Event, I'm just not sure how, or which javascript commands to use to call the ajax animation so the postback will still occur.

View 5 Replies

Execute Cmd.exe On Server And ImpersonateValidUser

Dec 9, 2010

I try to execute the "cmd.exe" program whith some argument. After see lot of website, I try to use impersonnation like [URL] After hours, I see I can launch cmd.exe only without argument but I see also in my Windows Server 2008 R2 task manager, the process cmd.exe is run under "test" account. I don't have user name "test" but it is the name of my ApplicationPool in IIS this is my code to launch CMD.EXE

[Code]....

the is no error but nothing run In my web .config I have enable <identity impersonate="true" /> I need to run CMD with argument from my ASPNET application on server.

View 3 Replies

Execute Exe On The Server Itself From Web Form

Apr 1, 2010

I know this question must had been asked 1000 times before and I have read every one of them I am trying to execute some exe on the server itself from web form. The exe just loads in the memory but do nothing. Sample Code

ProcessStartInfo myProcess = new ProcessStartInfo("notepad.exe");

View 6 Replies

Web Forms :: How To Execute A Method From A Different Server

Jan 24, 2011

I am not sure how to explain this but I will give this a try. Before, we had an app running on windows XP and all the reports were working fine. Now, the app is moved to windows 2008 server. There is one report in this app that uses Microsoft Interop.Excel which is used by component one. Apparently, interop.excel is not supported in windows 2008 with 64 bit running. After doing bunch of research, we have two options - either write this report again or execute this report from XP.

I want to try the second one. The interop.excel works fine in XP. A copy of this app is on this server. What would be the best way to execute this report from windows server 2008? It looks like i would have to connect to the XP server, get access to the app and finally the function that executes the report. Is this possible?

View 6 Replies

SQL Server :: Execute One Query For Two Different If Statement?

Jan 24, 2011

I need to excute one insert query basend on two different if conditins. If one of them conditions is true then excute block of code.

For Example,

if exists( select * from tablename where docid = @docid and adv_feed <> 'sent' ) or
if not exists (select * from usaa_audit_fields_log where docid = @docid)
begin
insert statement
end

I have tried using OR statement between them but it doesn't work.

View 2 Replies

DataSource Controls :: How To Execute 50MB SQL File (Micrsoft SQL Server) On Database Server Host

Jun 17, 2010

I have created database .sql file for create schema with export database. (its .sql file size is 48.2 MB)

View 1 Replies

SQL Server :: When Try To Execute The Procedure It Throws An Error

Oct 20, 2010

Having big problems with a stored procedure I'm trying to write. It seems really simple but when I try to execute the procedure it throws an error.

Here is the proc:

[Code]....

[Code]....

View 6 Replies

How To Execute Server Side Code From This Button

Mar 22, 2010

I have a button where I use an Animation Extender. When I click the button I have to set OnClientClick="return false;" otherwise the Animation Extender closes.
So that causes my problem. How do I execute server side code from this button?
I have tried this code in my code behind, but there is an error:

Code:
Dim strScript As String
strScript = "<script>"
strScript = strScript & "return false;"
strScript = strScript & "</script>"
ScriptManager.RegisterStartupScript(Me, GetType(Page), "MyScript", strScript, False)
This is my code for the Animation Extender:
Open data"></asp:Button>

View 3 Replies

SQL Server :: Procedure Or Function Has Too Many Arguments Specified When Execute

Sep 27, 2010

When i execute this SP in DB, it works fine. But when i execute from asp.net app it is throwing error: Procedure or function ... has too many arguments specified

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[sp_Customer]
@brchID char(40),
@brchName VARCHAR(50),
@userID VARCHAR(50)
AS
BEGIN
TRANSACTION
DECLARE @req_pk int
DECLARE @customer_org_pk int
IF EXISTS(SELECT * FROM [customer] WHERE [org_id] like @brchID)
BEGIN
SELECT [org_pk] FROM [customer] WHERE [org_id] like @brchID
END
ELSE
BEGIN
EXEC sp_get_next_control_no 'organization.org_pk',@customer_org_pk out;
INSERT INTO [customer] (org_pk,[org_id],[org_name])
VALUES(@customer_org_pk,@brchID,@brchName)
SELECT [org_pk] FROM [customer] WHERE [org_id] like @brchID
END
--Address Book Entry
IF NOT EXISTS(SELECT * FROM [address_book] WHERE [prsn_id] like @userID)
BEGIN
exec sp_get_next_control_no 'person.prsn_pk',@req_pk out;
END
IF (@@ERROR <> 0)
BEGIN
-- Rollback the transaction
ROLLBACK
RETURN
END
ELSE
BEGIN
COMMIT
END

Here is my asp method:

public static string Customer(string brchId, string brchName, string userId)
{
string spName = "st_Customer";
SqlParameter OrgPk = new SqlParameter("@org_pk", SqlDbType.Int);
OrgPk.Direction = ParameterDirection.Output;
OrgPk.Size = 50;
try
{
SqlHelper.ExecuteNonQuery(Config.ConnectionString,
CommandType.StoredProcedure, spName,
new SqlParameter("@brchID", brchId),
new SqlParameter("@brchName", brchName),
new SqlParameter("@userID", userId),
OrgPk
);
return Convert.ToString(OrgPk.Value);
}
}

View 4 Replies

SQL Server :: Execute Dynamic Query From The Resultset?

Aug 24, 2010

I've a resultset that returns some 55 rows which is typically a dynamic query like [Select column_name from table_name where column = condition].

I need to execute this query which is in resultset and insert the value of column_name into another table.

I dont get the way as how to make it. Kindly suggest me as how can I execute it.

View 1 Replies

SQL Server :: How To Open And Execute Stored Procedure

Aug 10, 2010

how to lock a stored procedure..

if its lock how to open and execute that stored procedure..

View 2 Replies

MVC :: Development Server Doesn't Appear To Execute JQuery?

Aug 6, 2010

Experienced a really strange problem today. I added a jquery script to my MVC application to collapse sections of a View (via divs).

Pretty standard stuff, he showed me the script working before hand and it works.

However any time I would run my MVC app via Visual Studio the script would not work. I changed browsers, re-imported the code from source control and basically me and my co-worker banged our heads together for some time trying to figure out why the exact same code was running different on two machines.

Publishing the MVC app to our web server and running worked for both machines but for some bizarre reason when I ran it on my VS it never did.

One thought that came to mind is that by VS uses the cassini default lightweight webserver for debugging, whereas my co-worker is using IIS.

This seems to suggest then that the ASP Development server does not support JQuery. Is this true and if not, what could the problem be?

View 8 Replies

DataSource Controls :: Query To Execute The Job In Sql Server?

Apr 12, 2010

Is there any possibility to execute the job in sql server. I want to create the Job. then through the quer i want to execute this Job by passing parameters. can we able to do this.Actucally i want to execute the SP from front end. but suddenly it should respond to the page. but that SP will run for nearly 5 minutes.

View 1 Replies

SQL Server :: Access Denied Execute Permission?

Aug 31, 2010

my company create for me a new database in new server hosting

the problem is that with new user's database, i cannot execute SP it return error that the user "username" do not have execute permission

the actual permission are :db_datareader,db_written,db_ddladmin

it seems not enought must i ask for add db_owner schema rom to user?

View 3 Replies

SQL Server :: Set Execute Permissions For Website At Web Host?

Sep 8, 2010

I have just succeeded doing a Publish to server from my local sql db and run the sql script on my web host's sql server 2005 db.

Now, I get the dreaded

The EXECUTE permission was denied on the object 'MyStoredproc', database 'db12345', schema 'dbo'.

error. I can't set the permissions from within Visual Studio, can I?

What should I ask the web host to do?

a) Should I ask them to globally set execute permission on ...?

b) Should I ask them to set execute permissions to ... for only INSERT/DELETE/UPDATE stored procedures?

c) Should I ask them nothing, and handle this myself? If so, then how? And, the question remains, should I set execute permissions globally or on a per stored proc basis? And what's the name of the user who needs the property set correctly?

The reason why I ask these questionsis that I used to work with winfomrs at a university. There people should have different permissions depending on what group of users they belonged to.

View 4 Replies

Security :: Execute Schtasks.exe On Server From Client?

Jan 6, 2011

I have an ASP.NET site on Windows Server 2008 (with is domain controller) and IIS7. The site is in a Pool which identidy is "ApplicationPoolIdentity"

I need to allow the user on my site to execute Schtasks.exe whith some arguments. but this doesn't work whithout error message.

I am sure it because user right, I won't to change the ApplicationPoolIdentity to "LocalService" or "NetworkService".

I try to launch Schtasks.exe whith code like this :

[Code]....

what is the best way to allow asp.net application to execute EXE on server with the minium right. ?

View 2 Replies

SQL Server :: Execute Permission Denied On Sp At Web Host?

Sep 9, 2010

I have recently succeeded doing a Publish to server from my local sql db and run the sql script on my web host's sql server 2005 db. Now, I get the "The EXECUTE permission was denied on the object 'MyStoredproc', database 'db12345', schema 'dbo'." error.I have Visual Studio Professional 2010, and that's where I create and manage my tables (in Server Explorer). However, when I right-click a stored procedure, I don't get a Seurity option or the like, where I could possibly set permissions.

I'm a bit usure of what SqlServer applications I have installed (as they are intertwingled with the Aps.Net stuff somewhat). When I look at Add/Remove software, this is what I find:

Microsoft Sql Server 2008 (562 MB)
Microsoft Sql Server 2008 Native Client
Microsoft Sql Server 2008 R2 Data-Tier Application Framework
Microsoft Sql Server 2008 R2 Data-Tier Application Project
Microsoft Sql Server 2008 R2 Management Objects
Microsoft Sql Server 2008 R2 Transact-Sql Language Service
Microsoft Sql Server 2008 Setup Support Files
Microsoft Sql Server Compact 3.5 SP2 ENU
Microsoft Sql Server Database Publishing Wizard 1.3
Microsoft Sql Server Database Publishing Wizard 1.4
Microsoft Sql Server System CLR Types
Microsoft Sql Server CSS Writer

Can I use any of these apps to set the security settings? Or would I possibly not be allowed to change any settings at the web host's Sqlserver 2005 server anyway (due to security reasons)? Frankly I don't think I could ask them to change the settings for over a hundred stored procedures, and then call them each time I create a new one.

And also, I can't understand what the point would be in setting different security levels on SELECTs and UPDATEs etc. After all, all my pages call UPDATE statements (for collecting statistics). I guess that the host could set execute permissions on the entire folder (not sure though) but it would of course be a stupid idea if I'm wrong regarding this matter.

View 4 Replies

Execute Client & Server Side Code With One Click?

May 18, 2010

i am not sure if my design have flaw but would like to know what others have to say, i am in a situation where i am trying to acheive two things in one click.

using : asp.net web form

i have a web form with few textbox and a gridview control and a button.

if i click on the button i am executing two things

1) asynchronously get data from server to client (working great) and able to display the data in the textboxes.

2) same click i want to bind the gridview.

[Code]....

recap:

1) jquery script execute asynchronously to get data from server to client and display in the textboxes
2) server side code to bind the gridview.

PROBLEM:

if i have onClientClick="return LoadDataById(); then it executes ONLY ajax code and does not execute server side but if have onClientClick="LoadDataById(); then it executes client and server but textbox value wipeout. (the textbox value popuplate through ajax)

View 2 Replies







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