473,396 Members | 2,139 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,396 software developers and data experts.

'Imports' statements must precede any declarations

I'm trying to do this:

<%@ Page Language="VB" %>
<script runat="server">

Imports System.Data
Imports System.Data.SqlClient

But i get this error on line 4:

BC30465: 'Imports' statements must precede any declarations.

THANKS!

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com

Nov 18 '05 #1
2 6867
you have to import like this when you are using script blocks (put this at the top of the page)

<%@ import namespace="system.data" %>

"David Lozzi" <dlozzi(remove-this)@delphi-ts.com> wrote in message news:eZ**************@TK2MSFTNGP12.phx.gbl...
I'm trying to do this:

<%@ Page Language="VB" %>
<script runat="server">

Imports System.Data
Imports System.Data.SqlClient

But i get this error on line 4:

BC30465: 'Imports' statements must precede any declarations.



THANKS!

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com


Nov 18 '05 #2
<%@ Import Namespace="YourNamespaceHere" %>

and it goes before the Page directive.
"David Lozzi" wrote:
I'm trying to do this:

<%@ Page Language="VB" %>
<script runat="server">

Imports System.Data
Imports System.Data.SqlClient

But i get this error on line 4:

BC30465: 'Imports' statements must precede any declarations.

THANKS!

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com

Nov 18 '05 #3

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

Similar topics

4
by: Hallvard B Furuseth | last post by:
Is there any reason not to structure my program like this? def ... def ... var = ... var = ... import ... import ... main_function()
5
by: Neil Zanella | last post by:
Hello, Unlike in pre-C99 versions of C where variables can only be defined at the beginning of blocks, C99 allows variables to be defined in arbitrary places inside blocks. However, gcc 3.2.2...
18
by: Fredrik Tolf | last post by:
Take a look at this C snippet: #include <stdio.h> int test(int *var) { return(*var += 5); } int main(void)
1
by: Steven K | last post by:
Hello, Is there a way to declare imports so that they don't have to be declared both in Master Page.vb and the Content Page.vb? For example, I have the following in the Master Page.vb Imports...
3
by: | last post by:
I'm picking up an 'IMPORTS' error for a simple database insert based on two input entry boxes in my form? It says an 'Imports' statement must preceede any declarations....... is this perahps the...
8
by: John A Grandy | last post by:
what are the various alternatives to including a group of imports statements in every module ? imports <namespace1.class1> imports <namespace2.class1> imports <namespace2.class2> etc.
4
by: Jeff Jarrell | last post by:
I am not really there yet with namespaces. I have a "common.dll" that is referenced from another project. now in the consuming project, source file to i'd like to have a "imports common". ...
20
by: Neroku | last post by:
Hello, i would like to know what the serious definition of statements and expressions is: i know an expression are evaluated to a value, i.e: 1 == 2 5+7 foo( 1,2) and a statement is...
5
by: kimiraikkonen | last post by:
Hello, I want to ask about "imports" statement. Some projects must be inserted with "imports xxxx" statements before beginning coding. But how do i know when to use or do i have to use "imports"...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.