By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

class's name has name same namespace 's name

P: n/a
My program has class's name same namespace 's name.
Ex
namespace clsvoucher
public class clsvoucher
..........
end class
end namespace
Can I use Dim a as clsvoucher or I must use Dim a as clsvourcher.clsvourcher
?
Thank. Sorry for my english
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Tuanhonanganh

The secondone, however why do you not try those simple things.

Cor
Nov 21 '05 #2

P: n/a
"tuanhoanganh" <ha****@sisvn.vn> schrieb:
My program has class's name same namespace 's name.
Ex
namespace clsvoucher
public class clsvoucher
..........
end class
end namespace
Can I use Dim a as clsvoucher or I must use Dim a as
clsvourcher.clsvourcher
?


You'll have to fully qualify the type name or define a type-alias using
'Imports'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
Actually it depends on where is declared the variable:

Namespace clsvoucher
Public Class clsvoucher

End Class
Public Class c1
Private m_o1 As clsvoucher.clsvoucher ' This causes error
"Type clsvoucher.clsvoucher is not defined"
Private m_o2 As clsvoucher ' This works fine
End Class
End Namespace

Namespace N2
Class c1
Private m_o As clsvoucher.clsvoucher ' This works fine

End Class
End Namespace
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"tuanhoanganh" <ha****@sisvn.vn> escribió en el mensaje
news:u8**************@TK2MSFTNGP15.phx.gbl...
My program has class's name same namespace 's name.
Ex
namespace clsvoucher
public class clsvoucher
..........
end class
end namespace
Can I use Dim a as clsvoucher or I must use Dim a as
clsvourcher.clsvourcher
?
Thank. Sorry for my english

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.