473,804 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question About Application_Sta rt in Global.asax and async functions

Hello people.

Short background -- I am constructing a web site that will have several
display tabs that are hooked up to different datatables in a SQL server.
Some of these tables are VERY large -- several million+ records. The tables
have records that are timestamped over several years and
months/quarter/weeks... depending on the individual table they can have
anywhere between 30 and 300 geography/time combinations.

What I would like to do in Application_Sta rt is to create several metadata
objects (datasets) that control what the drop down choices are for the user
to select on each of the main data pages. The problem is sometimes filling
these datatables takes 30-40 seconds+.

So: how do I create something in application_sta rt that fires off a
function that creates and populates my application level objects in a "fire
& forget " method. I can do threading and async calls all day long in win32
forms programming -- this is the first time though I've needed it in ASP.net

Thnx

Bob J
Nov 17 '05 #1
4 3925
Here are some resources on Threading in ASP.NET using System.Threadin g

http://msdn.microsoft.com/library/de...mthreading.asp
http://msdn.microsoft.com/library/de...eadpooling.asp

Here's a quick example. In this example, I'm writing to my db, and at the
same time, wanna email the user. So here's what I do:

In my button click event
{
ForkThreadSendI nviteEmails();
Response.Redire ct("default.asp x", true);
}

private void ForkThreadSendI nviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(Sen dInviteEmails)) ;
thEmailInvoice. Priority = ThreadPriority. AboveNormal;
thEmailInvoice. Start();
}
"Bob Johnson" <bo**********@n cmail.net> wrote in message
news:uz******** *****@TK2MSFTNG P11.phx.gbl...
Hello people.

Short background -- I am constructing a web site that will have several
display tabs that are hooked up to different datatables in a SQL server.
Some of these tables are VERY large -- several million+ records. The tables have records that are timestamped over several years and
months/quarter/weeks... depending on the individual table they can have
anywhere between 30 and 300 geography/time combinations.

What I would like to do in Application_Sta rt is to create several metadata
objects (datasets) that control what the drop down choices are for the user to select on each of the main data pages. The problem is sometimes filling these datatables takes 30-40 seconds+.

So: how do I create something in application_sta rt that fires off a
function that creates and populates my application level objects in a "fire & forget " method. I can do threading and async calls all day long in win32 forms programming -- this is the first time though I've needed it in ASP.net
Thnx

Bob J

Nov 17 '05 #2
sorry, I hit Sendtoo soon.

In my ForkThreadSendI nviteEmails function, you see the line:
Thread thEmailInvoice = new Thread(new ThreadStart(Sen dInviteEmails)) ;

You would also have to implement the SendInviteEmail s function.
"George Durzi" <gd****@hotmail .com> wrote in message
news:Oq******** ******@tk2msftn gp13.phx.gbl...
Here are some resources on Threading in ASP.NET using System.Threadin g

http://msdn.microsoft.com/library/de...mthreading.asp http://msdn.microsoft.com/library/de...eadpooling.asp
Here's a quick example. In this example, I'm writing to my db, and at the
same time, wanna email the user. So here's what I do:

In my button click event
{
ForkThreadSendI nviteEmails();
Response.Redire ct("default.asp x", true);
}

private void ForkThreadSendI nviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(Sen dInviteEmails)) ;
thEmailInvoice. Priority = ThreadPriority. AboveNormal;
thEmailInvoice. Start();
}
"Bob Johnson" <bo**********@n cmail.net> wrote in message
news:uz******** *****@TK2MSFTNG P11.phx.gbl...
Hello people.

Short background -- I am constructing a web site that will have several
display tabs that are hooked up to different datatables in a SQL server.
Some of these tables are VERY large -- several million+ records. The

tables
have records that are timestamped over several years and
months/quarter/weeks... depending on the individual table they can have
anywhere between 30 and 300 geography/time combinations.

What I would like to do in Application_Sta rt is to create several metadata objects (datasets) that control what the drop down choices are for the

user
to select on each of the main data pages. The problem is sometimes

filling
these datatables takes 30-40 seconds+.

So: how do I create something in application_sta rt that fires off a
function that creates and populates my application level objects in a

"fire
& forget " method. I can do threading and async calls all day long in

win32
forms programming -- this is the first time though I've needed it in

ASP.net

Thnx

Bob J


Nov 17 '05 #3
So the threading works exactly the same way as it does in windows forms?

"George Durzi" <gd****@hotmail .com> wrote in message
news:Oq******** ******@tk2msftn gp13.phx.gbl...
Here are some resources on Threading in ASP.NET using System.Threadin g

http://msdn.microsoft.com/library/de...mthreading.asp http://msdn.microsoft.com/library/de...eadpooling.asp
Here's a quick example. In this example, I'm writing to my db, and at the
same time, wanna email the user. So here's what I do:

In my button click event
{
ForkThreadSendI nviteEmails();
Response.Redire ct("default.asp x", true);
}

private void ForkThreadSendI nviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(Sen dInviteEmails)) ;
thEmailInvoice. Priority = ThreadPriority. AboveNormal;
thEmailInvoice. Start();
}
"Bob Johnson" <bo**********@n cmail.net> wrote in message
news:uz******** *****@TK2MSFTNG P11.phx.gbl...
Hello people.

Short background -- I am constructing a web site that will have several
display tabs that are hooked up to different datatables in a SQL server.
Some of these tables are VERY large -- several million+ records. The

tables
have records that are timestamped over several years and
months/quarter/weeks... depending on the individual table they can have
anywhere between 30 and 300 geography/time combinations.

What I would like to do in Application_Sta rt is to create several metadata objects (datasets) that control what the drop down choices are for the

user
to select on each of the main data pages. The problem is sometimes

filling
these datatables takes 30-40 seconds+.

So: how do I create something in application_sta rt that fires off a
function that creates and populates my application level objects in a

"fire
& forget " method. I can do threading and async calls all day long in

win32
forms programming -- this is the first time though I've needed it in

ASP.net

Thnx

Bob J


Nov 17 '05 #4
I have no experience with Windows Forms, but they're both using
System.Threadin g.

"Bob Johnson" <bo**********@n cmail.net> wrote in message
news:#l******** ******@TK2MSFTN GP10.phx.gbl...
So the threading works exactly the same way as it does in windows forms?

"George Durzi" <gd****@hotmail .com> wrote in message
news:Oq******** ******@tk2msftn gp13.phx.gbl...
Here are some resources on Threading in ASP.NET using System.Threadin g

http://msdn.microsoft.com/library/de...mthreading.asp

http://msdn.microsoft.com/library/de...eadpooling.asp

Here's a quick example. In this example, I'm writing to my db, and at the
same time, wanna email the user. So here's what I do:

In my button click event
{
ForkThreadSendI nviteEmails();
Response.Redire ct("default.asp x", true);
}

private void ForkThreadSendI nviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(Sen dInviteEmails)) ; thEmailInvoice. Priority = ThreadPriority. AboveNormal;
thEmailInvoice. Start();
}
"Bob Johnson" <bo**********@n cmail.net> wrote in message
news:uz******** *****@TK2MSFTNG P11.phx.gbl...
Hello people.

Short background -- I am constructing a web site that will have several display tabs that are hooked up to different datatables in a SQL server. Some of these tables are VERY large -- several million+ records. The

tables
have records that are timestamped over several years and
months/quarter/weeks... depending on the individual table they can have anywhere between 30 and 300 geography/time combinations.

What I would like to do in Application_Sta rt is to create several

metadata objects (datasets) that control what the drop down choices are for the

user
to select on each of the main data pages. The problem is sometimes

filling
these datatables takes 30-40 seconds+.

So: how do I create something in application_sta rt that fires off a
function that creates and populates my application level objects in a

"fire
& forget " method. I can do threading and async calls all day long in

win32
forms programming -- this is the first time though I've needed it in

ASP.net

Thnx

Bob J



Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11966
by: Max | last post by:
I've noticed some procedures don't run in the global.asax when you'd expect them to. I've rebuilt and set break points, but Application_Start just isn't firing today. Is there some configuration that prevents this from happening? I've never gotten Session_End to fire either. -M
6
5875
by: Saar Carmi | last post by:
Hi How can I get the application's virtual directory from the Application_Start method in Global.asax ? Keep in mind there is no request/response object available yet in this stage. Thanks Saar.
4
2146
by: NoNickname | last post by:
Hi, I need to get a string from a COM component at application start. (It's a Long Story and I cannot change this fact.) In ASP.NET 1.1, I simply called this COM component in Global.asax.cs from Application_Start, stuck the string in the HttpApplication.Application object and life was good. However, I've noticed in ASP.NET 2.0 you are not given the opportunity to create a .cs codebehind file for the Global.asax when you go to ADD NEW...
6
2226
by: Joe Befumo | last post by:
I just created the default personal site project in Visual Studio 2005, and it worked perfectly -- very nice. Next, I'd like to import some stat-capture code that I have working in a Visual Studio 2003 asp,net project. The first think I noticed is that in the 2003 project, there's a global.asax and a global.asax.vb file, with the code being in the latter. Since the 2005 project had a routine directly in the global.asax file, I moved it to...
7
2273
by: Christian Blackburn | last post by:
Hi Gang, Let me start by saying I'm using Visual Web Developer 2005 and ASP.net 2.0. Is there something I have to do to get my Global.asax fire when my application loads. If I set a breakpoint nothing happens also I can tell that it's not updating my database. I'm storing the users's session ID in the database to prevent multiple logins. However, when their session expires it's not clearning their record. Are there prohibitive...
6
3067
by: Harlan Messinger | last post by:
How do the Application methods like protected void Application_Start get called? They aren't base class overrides and they aren't implementing interface methods. What mechanism does the system use to call them? In a Web form, a similar handler like
0
2229
by: benny | last post by:
Hi, i'm trying to transform an anonymous user profile to an authenticated user profile. I found this global.asax here below and there are some things i don't understand. 1) where does the last function come from ( Public Sub Profile_OnMigrateAnonymous) because in VWDeveloper, that event doesn't appear in the available list of events?
4
6155
by: gamesforums | last post by:
Hi! I have some code within the Application_Start event in Global.asax that runs a sqlscript against my sql server to check the databas version. My problem is that sometimes the Application_Start event doesnt fire, it skips it and goes directly to my default.aspx file. I do the following: 1. IISReset.
0
1254
by: gamesforums | last post by:
Hi! I have some code within the Application_Start event in Global.asax that runs a sqlscript against my sql server to check the databasversion. My problem is that sometimes the Application_Start event doesnt fire, it skips it and goes directly to my default.aspx file. I do the following: 1. IISReset. 2. Deploy application files. 3. Start http://localhost/default.aspx
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.