473,796 Members | 2,495 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 3924
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
2144
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
2272
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
2226
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
6154
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
9529
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
10457
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...
1
10176
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
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9054
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...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4119
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
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.