working with an aspx file and with its code behind

liunx

Guest
i want in the aspxvb to do :

Dim myConnection As New SqlConnection("Provider=SQLOLEDB.1;UID=user;PWD=34234234;Initial Catalog=registration;Data Source=localhost;")


when i first put this code in the aspx page and did there the import to :

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

nut when i moved it to the VB page it seems not to work!
even when i removed the tags still isnt working!
why is that?
what i wanted to do is to seperate the code from the tags
but it isnt working why?
thnaks in advance
pelegif you want to seperate the code in a codebehind.

you do not do this,

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

you put all those import namespace thing within your code, in your aspx.vb file.

and then at the top of the .aspx file, you do this,

<%@ Page language="vb" Codebehind="WebForm1.aspx.vb" Src=http://www.webdeveloper.com/forum/archive/index.php/"WebForm1.aspx.vb" %>

and put all your coding in webform1.aspx.vb

tak
 
Back
Top