Import Namespaces

  • Thread starter Thread starter Jena
  • Start date Start date
J

Jena

Hi all,
i've an example where in the page.aspx there are two strings like these:

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

in the page_load sub, using this declarations I Can declare:

Dim objCommand As New OleDbCommand(strSQL, objConn)

i would like to do the same in the page.aspx.vb file but if I use the same
syntax to import System.Data and System.Data.OleDB i get an error.

Could anyone help me? Moreover, I can do the debug of page.aspx.vb file but
not in page.aspx. What' s I doing wrong?

Thanks all

Jena
 
In the VB file, this would be:

Imports System.Data
Imports System.Data.OleDb

The syntax is slightly different than the @Import directive used in
aspx.

Does that help?
 
Back
Top