473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Question About Application_Start 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_Start 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_start 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 3904
Here are some resources on Threading in ASP.NET using System.Threading

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
{
ForkThreadSendInviteEmails();
Response.Redirect("default.aspx", true);
}

private void ForkThreadSendInviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));
thEmailInvoice.Priority = ThreadPriority.AboveNormal;
thEmailInvoice.Start();
}
"Bob Johnson" <bo**********@ncmail.net> wrote in message
news:uz*************@TK2MSFTNGP11.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_Start 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_start 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 ForkThreadSendInviteEmails function, you see the line:
Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));

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

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
{
ForkThreadSendInviteEmails();
Response.Redirect("default.aspx", true);
}

private void ForkThreadSendInviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));
thEmailInvoice.Priority = ThreadPriority.AboveNormal;
thEmailInvoice.Start();
}
"Bob Johnson" <bo**********@ncmail.net> wrote in message
news:uz*************@TK2MSFTNGP11.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_Start 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_start 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**************@tk2msftngp13.phx.gbl...
Here are some resources on Threading in ASP.NET using System.Threading

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
{
ForkThreadSendInviteEmails();
Response.Redirect("default.aspx", true);
}

private void ForkThreadSendInviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails));
thEmailInvoice.Priority = ThreadPriority.AboveNormal;
thEmailInvoice.Start();
}
"Bob Johnson" <bo**********@ncmail.net> wrote in message
news:uz*************@TK2MSFTNGP11.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_Start 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_start 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.Threading.

"Bob Johnson" <bo**********@ncmail.net> wrote in message
news:#l**************@TK2MSFTNGP10.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**************@tk2msftngp13.phx.gbl...
Here are some resources on Threading in ASP.NET using System.Threading

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
{
ForkThreadSendInviteEmails();
Response.Redirect("default.aspx", true);
}

private void ForkThreadSendInviteEmails()
{
Thread thEmailInvoice = new Thread(new ThreadStart(SendInviteEmails)); thEmailInvoice.Priority = ThreadPriority.AboveNormal;
thEmailInvoice.Start();
}
"Bob Johnson" <bo**********@ncmail.net> wrote in message
news:uz*************@TK2MSFTNGP11.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_Start 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_start 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
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...
6
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...
4
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...
6
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...
7
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...
6
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...
0
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...
4
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...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.