Hi Mark,
Welcome to ASPNET newsgroup.
As for the global.asax file component designing problem, yes, in asp.net
2.0/vs2005, the global.asax has changed to not use code behind(all code be
put in asax file by default). Also, ASP.NET 2.0 page no longer mainly rely
on component (draged droped on component designer for page). For data
accessing, we use the DataSource controls instead of the Components
(DataAdapter and DataSet....). And for your scenario, you need get a
global scope DataSet to let other pages read the static datas, you can use
the new VS 2005 DataSet wizard to create a TypedDataSet , the new typed
DataSet wizard will also help us create a TableAdapter, which simplifies
the code for creating TypedDataset, e.g:
suppose we've created the following DataSet and TableAdapter:
(the code will be put in App_code dir)
DataSet1, CategoriesTable Adapter, then we can just use the below code to
create the global dataset in Application_Sta rt event
void Application_Sta rt(object sender, EventArgs e)
{
// Code that runs on application startup
DataSet1TableAd apters.Categori esTableAdapter adapter = new
DataSet1TableAd apters.Categori esTableAdapter( );
DataSet1 ds1 = new DataSet1();
adapter.Fill(ds 1.Categories);
Application["g_data"] = ds1;
}
this is what is being easied through the net TableAdapter components.....
So the original work in asp.net 1.1/vs2003 is not divided into to parts:
1. Use IDE wizard to create the typedDataSet and TableAdapter,
2. Use the TableAdapter to get the TypedDataSet instance ....
Here are some msdn reference about the TableAdapter:
#TableAdapter Overview
http://msdn2.microsoft.com/en-us/library/bz9tthwx.aspx
#TableAdapter Configuration Wizard
http://msdn2.microsoft.com/en-us/library/dex7k4dw.aspx
#How to: Create TableAdapters
http://msdn2.microsoft.com/en-us/library/6sb6kb28.aspx
Thanks & Merry Christmas,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| NNTP-Posting-Date: Fri, 23 Dec 2005 00:05:14 -0600
| From: Mark Olbert <Ch*********@ne wsgroups.nospam >
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Subject: ASP.NET 2.0: Global.asax Design Surface Gone
| Date: Thu, 22 Dec 2005 22:05:14 -0800
| Organization: Olbert & McHugh, LLC
| Reply-To:
ma**@arcabama.c om
| Message-ID: <ck************ *************** *****@4ax.com>
| X-Newsreader: Forte Agent 3.1/32.783
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Lines: 12
| X-Trace:
sv3-5Ntq93RzHckZwcp yWNViHv0C5LXsgf ulNlvYZG8LBTIms 4iqnfyXGL77l/orNaiRDiHQVShl
mtlY0sx!EOtCFvu Eclp6p544nSH9cV 0rVTIPp2hi5ArOt F2EIpsdi6DrPyi6 J5lK324SmvHHSpR w
cw==
| X-Complaints-To:
ab***@giganews. com
| X-DMCA-Notifications:
http://www.giganews.com/info/dmca.html
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.3.32
| Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!t-onli
ne.de!border2.n ntp.dca.giganew s.com!border1.n ntp.dca.giganew s.com!nntp.giga n
ews.com!local01 .nntp.dca.gigan ews.com!news.gi ganews.com.POST ED!not-for-mail
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3667 26
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| I have several ASP.NET 1.1 websites where I centralized a read-only
dataset (i.e., one which no web page ever changed) and its
| associated SqlDataAdapters .
|
| In 2.0 I noticed that the Global.asax file does not have a design
surface, so I can't drag and drop database components onto it.
|
| I could configure all this stuff manually, but that would be a lot of
work duplicating what the visual designers do just fine.
| Besides, it would put me way behind the curve on getting that promised
70% productivity improvement that I'm guaranteed by switching
| to ASP.NET 2.0 :).
|
| Is there a way to use the visual database tools in ASP.NET 2.0 in a
global setting for a website?
|
| - Mark
|