Using the Project's Login()-Method with VisualBasic.NET 2010

<p>Hello everybody,</p><p></p><p>I'm trying to develop a little program with the Empower Toolkit in VisualBasic.NET with Microsofts Visual Studio 2010 right now.</p><p>When I want to login to the database, it is not working the "normal" way like stated in the Empower Toolkit Programmer's Reference Guide.</p><p>I typed the following:</p><p></p><p>Dim databaseLogin As MillenniumToolkit.Project</p><p>databaseLogin = new Project()</p><p>databaseLogin.Login("myDatabase", "", "myusername", "mypassword")</p><p></p><p>But I got an error message that says: "Login" is equivocal, because different kind of members with the same name are existing in interface "MillenniumToolkit.ITkProject5"</p><p></p><p>So does anybody know which method or class I have to use to login into my database and projects?</p><p></p><p>Any help is very much appreciated.</p>


  • SamHao

    Not sure whether this helps or not, but here is the example code in the Empower Data Explorer source code that you can download from the support site:

    Dim empProj As MillenniumToolkit.ITkProject3

    empProj = New MillenniumToolkit.ProjectClass()

    empProj.Login(databasename, projectName, username, password)

    If you read the whole code for the EmpowerController Class in the Empower Data Explorer example code, it gives more details on how to obtain the database list and project array.

  • Dot


    Another useful bit of information is this occurs because of overloading in the toolkit interface and VB.NET can't handle it.

    This is caused by the different way VB handles interfaces. There are multiple instances of the Login function defined in the inheritance of the Project interfaces (there are different versions of the tkProject interface, each inheriting from the previous versions) and although C# can cope with this, Visual Basic cannot.

    Casting to the earlier version of the interface (where there is no ambiguity) solves the problem.

                Dim prj as MillenniumToolkit.ITkProject3

                prj = new MillenniumToolkit.ProjectClass()

                prj.Login( "", "Defaults", "hope", "Pray")