'Imports' statements must precede any declarations

  • Thread starter Thread starter David Lozzi
  • Start date Start date
D

David Lozzi

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!
 
you have to import like this when you are using script blocks (put this at the top of the page)

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top