Category Archives: Multithread

[RESOLVED] Upload Large Excel File

i have a large excel file which has 1 lakh row , i want to insert these data in my table i am using entity framework for insert but it takes more than

45 minutes to insert which is too much, i want to speed up the uploading process what should i do.

can I use multithreading for it if yes then how i can use ?

if any other way to do this process then please suggest

 

Thanks

Manish Chandra kumar

Hi,

Please read this blog. This will help you.

http://blog.sqlauthority.com/2008/01/08/sql-server-2005-export-data-from-sql-server-2005-to-microsoft-excel-datasheet/

You can create a stored procedure and pass the Excel Path. This will more faster rather for loop.

Regards

Shwetamber Chourey

India

[RESOLVED] Render web form before function in PageLoad completes

I have a web page that contains some text. It is not inside any asp control. It is inside the html body within a <p> tag.

When the user opens the page, there is a function that executes during Page_Load. At the end of the function, it pops up a file open/save dialog. This function can run for some time (sometimes more than a minute) depending on the amount of data. I would like the users to see the text in the body even when the function is been processed. Right now this isn't possible since the function is executed automatically during Page_Load, which happens before the page renders.

If this is not possible then any other creative solution is appreciated.

 

Thanks.

Use AJAX, WebServices etc...U need asynchronous postback.

Not sure if are using window.onload = function(){ } for page_load event? If not, try it out, coz window.onload only when all the page content is downloaded and rendered in  the page..

the load function is serverside function, not clientside.

Anuj, do you have any example? Thanks.

Try 

http://aspalliance.com/329

 

http://msdn.microsoft.com/en-us/library/ms978607#diforwc-ap02_plag_howtomultithread

 

http://www.ajaxmatters.com/2006/05/dealing-with-long-running-processes-in-asp-net/

 

If it would not help please let us know what ctually you want as your question is really abstract.

Happy Coding!!!

realGaurab

Anuj, do you have any example? Thanks.

Probably i think you can do this with Async Pages in asp.net - 

http://msdn.microsoft.com/en-us/magazine/cc163725.aspx

Thanks.

Thank you everyone for your reply. I will try to get something working. If I can figure something out then I will post the sample code.

[RESOLVED] How ASP.NET Web Pages Threading Multi Tasking Works for Single user

How ASP.NET Web Pages Threading / Multi Tasking Works for Single user?


This Might be a very basic Questing. (URGENT)

I have a Web application with multiple pages.

When a user is Logged in using Visual Studio(Development) / IIS (Production )

If the user have opened a Page 1 from home page which is long running process (Lets say few minutes)

Can the same user open Page 2 from home page while Page 1 is still running.

There is no connection between Page1 and Page 2.

Remember I am talking about the same user in the same machine.

Does ASP.NET takes care of this MultiThreading by default for above situation?

Or I Should create Separate Thread for each page?

I my case I not able to open the second page still the first page is Finished.

Please shed me some light.

Regards

you can open any number of pages.., asp.net/iis is capable of handling mutiple requests..

But the thing is when you are opening a page1 in the browser.., you have to wait until it completes the request to open anotehr page in the same tab/window..,

If you want to open it another tab/window  you just right click on the page and open the page2 in new window/tab

this is the browser feature.., so keep in mind that asp.net/IIS can handle mutilple requests at a time

Yes, ASP.NET handles threading. If you request multiple pages then it can process both at the same time, even if one is long running. However, as already stated, you can't access the second page from the same browser window until the first page has finished. If you're looking at having the user start a long running process, and that process to continue in the background while a response comes straight back to the user, then you'll have to execute that on another thread. Look into the Task class.

Thanks for your Replys.

I am not able to achive multi threading. Some thing is stoping it.

I think its some thing to do with sessions.

I even tried commenting in global.asax the following methods.

 //void Session_Start(object sender, EventArgs e)
    //{
    //    // Code that runs when a new session is started

    //}

    //void Session_End(object sender, EventArgs e)
    //{

    }//

But no use.

Iam able to excecute only one page at a time.

( ITs a shame my website ia very large apllication having few 100 of classes)

But i use sessions through out all the pages. and No session is waiting for other to be updated they are all autonomus

Any help.