|
-
Sep 14th, 2025, 11:56 AM
#1
Thread Starter
Junior Member
[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'.
-
Sep 14th, 2025, 12:59 PM
#2
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
 
-
Sep 14th, 2025, 03:01 PM
#3
Thread Starter
Junior Member
Re: VB.NET Ambiguous error in VS 2022
 Originally Posted by Shaggy Hiker
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 . .
-
Sep 14th, 2025, 05:14 PM
#4
Thread Starter
Junior Member
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
-
Sep 14th, 2025, 09:41 PM
#5
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.
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|