Import Namespaces

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
 
S

Scott Allen

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?
 

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

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top