MySQL .NET Connector Error

I Have a WCF webservice that uses a separate MVC assembly to form object from a database using. The MVC contains the reference to the MySQL connector but every time I try to run a query I get the following the error shown in code.. I know my connection is right because I've copy and pasted it directly form a working windows app.. Is there something new with how WCF webservices work or it a problem that I have the methods in a separate assembly?

"Key cannot be null. Parameter name: key"
Stack Track:
   at System.Collections.Hashtable.ContainsKey(Object key)
   at System.Collections.Hashtable.Contains(Object key)
   at MySql.Data.MySqlClient.MySqlPoolManager.GetPool(MySqlConnectionStringBuilder settings)
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

Open in new window

Who is Participating?
UmeshConnect With a Mentor MySQL Principle Technical Support EngineerCommented:
Can you post your table description & insert statement?
UmeshMySQL Principle Technical Support EngineerCommented:
joshkrakAuthor Commented:
Lol, yea, this was the first one I saw, but if you look at my stack trace, the error is coming from within the managed mysql connector. My code has abosultely nothing to do with hashtables. Its a DataTable that I'm trying to fill.
joshkrakAuthor Commented:

'aff_id', 'int(10) unsigned', 'NO', 'PRI', '0', ''
'delta', 'int(10) unsigned', 'NO', 'PRI', '0', ''
'aff_name', 'varchar(45)', 'YES', '', '', ''
'created', 'datetime', 'YES', '', '', ''
aff_id and delta form the primary key
I actually get this error regardless of it being a SELECT or INSERT
SELECT Statement:
SELECT * FROM affiliates WHERE aff_id=?AffId ORDER BY delta DESC LIMIT 1
The code that exectues the command (Parameters where added before hand)
                Dim Adapt As New MySqlDataAdapter(Cmd)
                Adapt.FillLoadOption = LoadOption.OverwriteChanges
                Adapt.AcceptChangesDuringFill = True
Connection string

Open in new window

joshkrakAuthor Commented:
Omg, this is embarrassing. I wasnt passing in the connectionstring when initializing the MySqlConnection :(
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.