How can i resolve naming conflicts between namespaces having classes wih same names . Suppose i hav 2 namespaces n1 and n2 and having classes with same name.i want to import these namespaces in to my class.then how can i resove the conflicts.

Showing Answers 1 - 1 of 1 Answers

Prasad

  • Mar 17th, 2006
 

by declaring variables of the class along with its namespace ... as follows

First Ur Name Space

Namespace n1

Public Class x

Sub show()

MsgBox("n1")

End Sub

End Class

End Namespace

Namespace n2

Public Class x

Sub show()

MsgBox("n2")

End Sub

End Class

End Namespace

 

Then on Form One

Imports WindowsApplication1.n1

Imports WindowsApplication1.n2

Public Class Form1

Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

 ......................................

#End Region

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim x As New n1.x

Dim x2 As New n2.x

x.show()

x2.show()

End Sub

End Class

 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions