.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

synchronous execution

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :Windows Application

I have a winform application that has a long process running.  I ended up using a worker thread to keep the not responding message being sent to the form.  However, I really do not want anyone executing any other procedure while this process is running.  What are my options.  I do not want to disable the form just kind of lock it until the process is finished.



View Complete Post

More Related Resource Links

.NET Matters: Ordered Execution With ThreadPool


This month we demonstrate how you can use the ThreadPool to support ordered execution without having to build custom thread pools yourself.

Stephen Toub

MSDN Magazine February 2009

Count Query Execution


I have a class that being used to connect with the DB. Now I want to count how many times each web request executes the queries, but I've no idea where to store the counted value. I mean, Session wont, ViewState wont work as site also have webservices. What else I can use ?

Doubt in sp execution

Hi,  i am executing sp in one of my database it is taking 4 minutes to complete execution. where as i am executing same sp in different database it is taking only 1 millisecond to complete execution. i have checked the table settings such as index and table data also everything is same. now i want to find where is the problem. what are steps to find such kind of problems.

Slow query execution

Hello, I have a strange problem that suddenly happened. I have a Windows 7 Ultimate OS running SSMS 2008. When I run a query or an stored proc against a server (the server is remote and passes through a VPN tunnel) it can take me 40 seconds to get the query to complete. But when I run a similar query against another server located at the same location (go through the same tunnel) I get the results in 1 second.  I select about 400 rows on both servers. The slow response comes from a server that runs sql 2005 and the fast response is sql 2008. I asked a friend that works in the same office with me and uses the same connection as I do to run the same queries and he gets the result in 1 second. Does anyone has any ideas what can cause such problems?  I tried to remove and reinstall all the sql server components from my computer but nothing helped? Thanks, Oded Tal

Staying with the SQL Agent during Execution

I need to create a stored procedure that triggers off a particular job in the SQL server 2005 agent, waits for the job to complete and then returns back the control to the calling application with the job execution results. As far as triggering off the SQl server agent is concerned, I can use the sp_start_job procedure. But what is the best way to wait for the job to complete execution (Because the sp_start_job proc returns back the control immediately after starting the job). I could use the sp_help_job proc in a loop and wait for the value of the "current_execution_status" column to change from 1 to 4...but is there a better way of doing this? Appreciate inputs here. - Thanks, Manmeet

Wierd error during execution of SerializeReply of IDispatchMessageFormatter

I am trying to develop a WCF REST app as explained in http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/04640a45-1a37-4722-8ed7-9f75c155dc14 (which serves both XML and JSON at the same time). the error is in the return statement of the following code: Public Function SerializeReply(ByVal messageVersion As System.ServiceModel.Channels.MessageVersion, ByVal parameters() As Object, ByVal result As Object) As System.ServiceModel.Channels.Message Implements System.ServiceModel.Dispatcher.IDispatchMessageFormatter.SerializeReply Dim formatter As IDispatchMessageFormatter = Me.xmlFormatter If OperationContext.Current.OutgoingMessageProperties.ContainsKey(WebBodyFormatMessageProperty.Name) Then Dim webBody As WebBodyFormatMessageProperty = DirectCast(OperationContext.Current.OutgoingMessageProperties(WebBodyFormatMessageProperty.Name), WebBodyFormatMessageProperty) If webBody IsNot Nothing AndAlso webBody.Format = WebContentFormat.Json Then formatter = Me.jsonFormatter End If End If Return formatter.SerializeReply(messageVersion, parameters, result) End Function It gives the error as "The given key was not present in the dictionary." further going deeper the stack trace looks like the following: Encountered unexpected namespace 'http://schemas.microsoft.com/ws/2005/05/envelope/none'. The namespace must be empty. Parameter name: ns

Improper execution plan with scalar function

Run the following sql in an empty db(in my case, sql 2008): create table t (id int) go declare @i int set @i = 1 while @i <= 1000 begin insert t values (@i) set @i = @i + 1 end go create function f(@i int) returns int as begin return (select count(*) - 10000+@i from t) end go Then run the following sql a, it's slow, used 6 seconds, yet sql b is very fast. Their execution plans are totally different. Can sql a run as fast as sql b? If not, why? -- sql a declare @i int set @i = 500 select * from t where id = (select dbo.f(@i)) -- sql b select * from t where id = (select dbo.f(500)) Thanks!

Sporadic .NET application crash with "Fatal Execution Engine Error"

I have a .NET application that runs for several hours.  It is a multi-threaded app that does some calculations and saves the results to the database.   On one machine in particular, it has been crashing recently with the following exception recorded in the Event Log: .NET Runtime version 2.0.50727.4206 - Fatal Execution Engine Error (6C9D7B6E) (80131506) Faulting application AnalyzerConsole.exe, version, time stamp 0x4c76d28b, faulting module mscorwks.dll, version 2.0.50727.4206, time stamp 0x4bf4c6a7, exception code 0xc0000005, fault offset 0x0011627d, process id 0x%9, application start time 0x%10. Sometimes it runs for hours without crashing, but usually it will crash eventually. I have captured a dump, and this is the call stack: > ntdll.dll!_DbgBreakPoint@0()   mscorwks.dll!WatsonLastChance()  + 0x133 bytes   mscorwks.dll!EEPolicy::LogFatalError()  + 0x23c bytes   mscorwks.dll!EEPolicy::HandleFatalError()  + 0x47 bytes   mscorwks.dll!CLRVectoredExceptionHandlerPhase3()  + 0x10dae2 bytes   mscorwks.dll!CLRVectoredExceptionHandlerPhase2()  + 0x20 bytes   mscorwks.dll!CLRVectoredExceptionHandler()  + 0xb7 bytes   mscorwks.dll!CPFH_RealFirstPassHandler()  + 0x8ac bytes   mscorwks.dll!_COMPlusFrameHandler()  + 0xb9 bytes   ntdll.d

CPU killer when showing execution plan when having a missing index

Hi you all! Do you have problems with flickering and CPU getting high when you show the execution plan for a SQL Statement AND there is a missing index suggestion? See related connect id: https://connect.microsoft.com/SQLServer/feedback/details/360457/hovering-mouse-over-execution-plans-query-line-is-cpu-killer I really hope someone from Microsoft can take a look at this a give us a status update, over TWO years since I reported it and still an issue. Have you experienced the same? Please vote the bug up to "raise" the flag.Best regards Arild Røksund, Norwegian developer (SQL & .net), Omega AS (please Vote as helpful if helpful)

improve sql execution time

i need to select one of the record out of 10 thourands record,but when the program execute the sql , it takes a long time to extract data and my PC indicate low memory alert.   how can i improve the execution time to select the data from sybase

IE cannot display the webpage during report execution

Hi. I have a problem with a report having some T-SQL and MDX queries. When I execute it during the working hours I have an error about that Internet Explorer cannot display the web page, but in the other hours the execution is completed successfully. I have a look inside RS log but I cannot find any errors; no timeout is set about report execution inside the Report Manager. Any ideas to solve this issue, please? Many thanks

Execution Plan in Activity Monitor (Recent Expensive queries)

If we see the execution plan of a query in Activity Monitor > Recent Expensive Queries is it Estimated Execution Plan or Actual Execution Plan ?

Long execution times for Search pages even after 4th or 5th user has accessed the same page.

Hi Guys We have a Sharepoint 2010 farm with two NLB web fronts ends, a Index server and a two box SQL cluster. The same problem also occurs on a dev box which has Sharepoint 2010 and SQl server running on the same single box. When a user access the search or advanced search page we get long execution times of between 15 and 30 seconds.  The strange thing is that the user will have a slow response the first time, then they are fine for a period of an hour or two and then they hit the slow response again.  Below i have copied info from the developer dashboard.  Does anyone have a suggestion of where to start tackiling this issue. Thanks 1st Run.  (Note this site was accessed by 3 other users first) BeginRequestHandler (0.05 ms) PostAuthenticateRequestHandler (0.06 ms) PostResolveRequestCacheHandler (18.48 ms) GetWebPartPageContent (16.87 ms) GetFileAndMetaInfo (15.57 ms) GetWebPartPageContent (35.25 ms) GetFileAndMetaInfo (34.99 ms) GetWebPartPageContent#1 (89.27 ms) GetFileAndMetaInfo (89.06 ms) Add WebParts (3975.17 ms) Search Box (3974.54 ms) SearchBoxEx.OnLoad (15426.56 ms) SearchBoxEx.HandleContextualScoping (0.01 ms) UserPreference.GetUserPreference (15418.52 ms) UserPreference.GetFromCache (0.04 ms) SearchServiceApplicationProxy.GetUse

Automatic Workflow execution

Hi folks, I have a task list which i have set to (require content approval for submitted items). I want to move the tasks which are APPROVED to another approved list. To accomplish it, i created a workflow in SPD. if Current Item:Approval Status equals 0;#Approved                 Email Current Item:Assigned To                 then Copy item in Current Item to Approved Tasks                 then Delete item in Current Item   I have set the workflow to automatically start when a new item is created or changed. When i approve a task; the workflow does not start. I have to manually start the workflow which then works fine as designed. Please advise what is missing for the automatic worklflow execution to work.You miss 100% of the shots you do not take!
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend