Results 1 to 5 of 5

Thread: [RESOLVED] VB.NET Ambiguous error in VS 2022

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2013
    Posts
    16

    Resolved [RESOLVED] VB.NET Ambiguous error in VS 2022

    I am trying to load a large collection of data lines to a MYSQL database. The database is created and is local and is visible in MYSQL workbench. I have installed MySQL Connector and mySQL is visible in the solution explorer . I am getting a ambiguity error, and 2 others - see below.

    I have followed (I think) the MS instructions with this code :

    Public Sub Init()
    Dim MySqlClient As String = "MySQL84"
    Dim mySQLConnectionString As String

    mySQLConnectionString = "server=127.0.0.1:3306;" & "uid=root;" & "pwd=1212Tyke!;" & "database=pooldata;"

    Dim conn As New MySql.Data.MySqlClient.MySqlConnection(mySQLConnectionString)
    conn.ConnectionString = mySQLConnectionString

    Try
    conn.open()
    MsgBox("Connected to database")

    Catch ex As Exception 'errorString 'MySql.Data.MySqlClient.MySqlException

    End Try
    End Sub

    I get the following 3 errors

    'Data' is ambiguous in the namespace 'ConsolidatedPoolData.MySql'.
    'connectionstring' is not a member of 'MySqlConnection'.
    'open' is not a member of 'MySqlConnection'.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    Re: VB.NET Ambiguous error in VS 2022

    The first line is probably all of the problem. I would expect the other two errors arise due to the first one, though that may be a misunderstanding.

    What is ConsolidatedPoolData? I don't recognize that, though I also don't work with MySQL. Whatever it is, that first error means that there is more than one ConsolidatedPoolData.MySQL.Data. That name could resolve to more than one thing and the compiler can't figure out which to use. Normally, this gets solved by further decorating the name to identify the right one to use. In this case, that name is pretty well decorated already, which suggests that by some means, ConsolidatedPoolData is referenced twice in the project, and not quite the same way, perhaps.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2013
    Posts
    16

    Re: VB.NET Ambiguous error in VS 2022

    Quote Originally Posted by Shaggy Hiker View Post
    The first line is probably all of the problem. I would expect the other two errors arise due to the first one, though that may be a misunderstanding.

    What is ConsolidatedPoolData? I don't recognize that, though I also don't work with MySQL. Whatever it is, that first error means that there is more than one ConsolidatedPoolData.MySQL.Data. That name could resolve to more than one thing and the compiler can't figure out which to use. Normally, this gets solved by further decorating the name to identify the right one to use. In this case, that name is pretty well decorated already, which suggests that by some means, ConsolidatedPoolData is referenced twice in the project, and not quite the same way, perhaps.
    Hi - and thanks for the quick reply - The actual database is pooldata - the consolidated name was from one of many prior attempts. So my plan is to start a new project . .

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2013
    Posts
    16

    Re: VB.NET Ambiguous error in VS 2022

    Wow - you set me on a fruitful path - another 4 or 5 restarts and the code is clean - but gets stuck - perhaps because the database is empty. I'll close this thread and send a sos when stuck again! Best

    Bob

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB.NET Ambiguous error in VS 2022

    You can't close a thread, but you can use the Thread Tools menu to mark it Resolved, so we can see that you need no more help without having to open the thread and read it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width