Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Import namespace in Visual Studio .Net 1

Status
Not open for further replies.

johneydluca

Programmer
May 29, 2002
25
0
0
US
Hi
I am a new developer to ASP.NET (Visual Studio,net). I tried my best but could not fing how to Import namespaces in the Program. i have a very basic question. sorry to ask such a silly query.

To create asp.net program using database I need to import following 3 namespaces which all books write .
<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.OleDb" %>
<%@Import Namespace="System.Data.SqlClient" %>

But using Visual Studio it creates following 3 files for each program
.aspx
.aspx.vb and
.aspx.resx

Out of above 3 filed which one should I add these three import statements? Or is their any other better way like the way we had in VB6 like using Import COM Dll (How to do this)?

thanks

jd
 
Hi there!
.aspx - html code
.aspx.vb - codebehind
.aspx.resx - debug file (if I'm not mistaking)
Since you're using VS.NET to develop your web application, you should use codebehind for your programming and let the aspx page only for html code.
So you should import the namespaces in .aspx.vb file, like this:
Code:
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.SqlClient
Hope this helps!

[morning]
 
Hi Joulius
Thanks a lot. As suggested by you I added above code to my program and it worked very well.

thanks a lot again.

jd
 
.aspx.resx is a resource file, which allows you to hold resources for the page - this can be anything from string tables to image data etc (mime types are a field). Incredibly usefully, this stuff can hold data localized for particular culture options.

System.Resources and the ResourceManager class in particular hold more info :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top