473,320 Members | 1,856 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,320 software developers and data experts.

@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!
Nov 18 '05 #1
1 4055
inline
-----Original Message-----
Tw part question:
1 - Is it <% @Import Namespace..... or <%@ Import Namespace... ? I'm seeingit both ways in a book (but I think one is a typo. My pages don't seem tocare 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 oneach 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
Nov 18 '05 #2

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

Similar topics

0
by: Arjen | last post by:
Hi, I use form authentication for my asp.net 2.0 webapplication. When a user request a page it must first load some settings. These settings will be placed inside the context.items. I can add...
1
by: khawar | last post by:
please provide code sample, i was having trouble declaring interger and string variable and can we also initialize them at the same time thanks for help
14
by: paul downing via DotNetMonster.com | last post by:
global file email send -------------------------------------------------------------------------------- guys, i'm developing an application and want to send an email with an error if it occurs...
1
by: DavidM | last post by:
What is the difference between the Application_AuthenticateRequest and the Global_AuthenticateRequest events? I see that that the Global_AuthenticationRequest even fires before the...
4
by: Chris | last post by:
Hi, I want to put the namespaces and the data connection into global.asax like this: <%@ import namespace="System.Data"%> <%@ import namespace="System.Data.OleDb"%> <script runat="server">...
1
by: Groove | last post by:
Hey guys - I'm sure this is a commonly asked question but here goes. I'm trying to catch the error in my global.asax file and redirect to a error page which will email me the actual error upon...
0
by: Alias | last post by:
Hi - I have a site that runs on a development and production server. I'd like to programmatically change the connection string the provider uses in the web.config file and have the provider use...
5
by: baburmm | last post by:
Hai, I want to get the Global static name(for Constant) Declared in the Global.asax file for my whole project as a constant. my coding in the Global.asax file is private static string strName =...
0
by: Vinnarasi | last post by:
This is the error i get when i try to setup a portal which is built using rainbow portal. The type 'Rainbow.Global' is ambiguous: it could come from assembly...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.