Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   @Import Syntax and Importing Namespaces in global.asax file (http://www.velocityreviews.com/forums/t70453-import-syntax-and-importing-namespaces-in-global-asax-file.html)

D. Shane Fowlkes 01-13-2004 02:00 PM

@Import Syntax and Importing Namespaces in global.asax file
 
Tw part question:
1 - Is it <% @Import Namespace..... or <%@ Import Namespace... ? I'm seeing
it both ways in a book (but I think one is a typo. My pages don't seem to
care which it is. Or do they?....see below

2 - I'm trying to import the namespaces of System.Data and
System.Data.SQLClient in the global.asax file so I don't have to do this on
each page using SQL Server commands and data. But it doesn't seem to work.
I read you can do this. What's the trick if it's possible to do this? My
@Imports are above my <script> tag in the asax file like so:

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>


<script language="vb" runat="server">
Sub Session_OnStart
....etc

Thanks guys!



Tu-Thach 01-13-2004 02:55 PM

Re: @Import Syntax and Importing Namespaces in global.asax file
 
inline

>-----Original Message-----
>Tw part question:
>1 - Is it <% @Import Namespace..... or <%@ Import

Namespace... ? I'm seeing
>it both ways in a book (but I think one is a typo. My

pages don't seem to
>care which it is. Or do they?....see below


I don't think it matters.

>2 - I'm trying to import the namespaces of System.Data and
>System.Data.SQLClient in the global.asax file so I don't

have to do this on
>each page using SQL Server commands and data. But it

doesn't seem to work.
>I read you can do this. What's the trick if it's possible

to do this? My
>@Imports are above my <script> tag in the asax file like

so:
>
><%@ Import Namespace="System.Data" %>
><%@ Import Namespace="System.Data.SqlClient" %>
>
>
><script language="vb" runat="server">
>Sub Session_OnStart
>....etc
>


You have to import it into each individual page.

Tu-Thach


All times are GMT. The time now is 07:33 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.