Importing Multimple Namespaces?

  • Thread starter Thread starter Curt
  • Start date Start date
C

Curt

I imported the namespace System.Data.Oledb into my global.aspx file to
create a global database object there. When I went into one of my web
forms and tried to create an oledb command object, intellisense didn't
pick it up. I had to import the same namespace at the top of that
form's code. This seems odd to me. Do I have to import all the
appropriate namespaces for each form? Is there way to import a
namespace so that it applies globally to all web forms in a project?
 
You have to import the appropriate namespaces for each new source code
document you create. As each new form is created as a new document in
winforms, this would be why you have to import the same libraries over and
over.

Perhaps you should look into creating a user control to inherit into
multiple classes?
 
If you are using VS .NET, you can create a project wide imports via the
project's property dialog.
 
Thanks for the reply. I'm not quite following you about the user
control. How could that solve the problem? (Not that it's such a big
problem, I just wanted to make sure I wasn't being unncessarily
redundant).

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Back
Top