Link to home
Start Free TrialLog in
Avatar of addicktz
addicktz

asked on

Key cannot be null, but what key!!!

I am in the final debug`ing stages and i am have got this error twice and no others, please help i want to be done!
is this a key from one of my hashtables, or a key in someplace dealing with the sql client?


System.ArgumentNullException: Key cannot be null.
Parameter name: key
   at System.Collections.Hashtable.ContainsKey(Object key)
   at System.Collections.Hashtable.Contains(Object key)
   at MySql.Data.MySqlClient.CharSetMap.GetEncoding(DBVersion version, String CharSetName)
   at MySql.Data.MySqlClient.NativeDriver.GetFieldMetaData41()
   at MySql.Data.MySqlClient.NativeDriver.GetFieldMetaData()
   at MySql.Data.MySqlClient.NativeDriver.ReadFieldMetadata(Int32 count, MySqlField[]& fields)
   at MySql.Data.MySqlClient.CommandResult.Load()
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at ADK.MySqlBase2.GiveMeDataSet(String SelectCommand) in h:\adk\software\adkserver\base\sqllibrary\sqllibrary.cs:line 83
ASKER CERTIFIED SOLUTION
Avatar of TheAvenger
TheAvenger
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prashantgoela
prashantgoela

Yup, the "key" value you are passing to the "ContainsKey" method of hashtable seems to be null..
SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of addicktz

ASKER

           public DataSet GiveMeDataSet(string SelectCommand)
            {
                  MySqlDataAdapter dsDap = new MySqlDataAdapter(SelectCommand, myConnection);
                  DataSet dsMine = new DataSet();
                  
                  try
                  {
                        dsDap.Fill(dsMine);     // line 83
                  }
                  catch (Exception ex)
                  {
                        FireAp(ex.ToString());
                        dsMine = null;
                  }
                  finally{}
           
                  dsDap.Dispose();
                  return dsMine;
            }
What does the 'SelectCommand' text equal?

Bob
i am not sure, i am currently overwhelmed with errors......


System.IO.IOException: Unable to write data to the transport connection. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.BufferedStream.FlushWrite()
   at System.IO.BufferedStream.Flush()
   at MySql.Data.MySqlClient.PacketWriter.FlushBuffer()
   at MySql.Data.MySqlClient.PacketWriter.Flush()
   at MySql.Data.MySqlClient.NativeDriver.Authenticate411()
   at MySql.Data.MySqlClient.NativeDriver.Authenticate()
   at MySql.Data.MySqlClient.NativeDriver.Reset()
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlPoolManager.GetConnection(MySqlConnectionString settings)
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
   at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at ADK.MySqlBase2.GiveMeDataSet(String SelectCommand) in h:\adk\software\adkheaderserver\base\sqllibrary\sqllibrary.cs:line 83
SELECT COUNT(*) FROM tblADKIndex WHERE subject = 'Ghost Whisperer - "GhostWhisperer-104 MendedHearts.ws.hdtv-xvid-fov.svcd.snoconv.part43.rar" yEnc (25/47)' AND fromuser = 'yeahlosno@eatme.com (yeahlo snoADKcparKDA' AND filen = 'GhostWhispererADKminusKDA104 MendedHearts.ws.hdtvADKminusKDAxvidADKminusKDAfov.svcd.snoconv.part43.rar'

MySql.Data.MySqlClient.MySqlException: Connection unexpectedly terminated
   at MySql.Data.MySqlClient.PacketReader.Read(Byte[]& buffer, Int64 pos, Int64 len)
   at MySql.Data.MySqlClient.PacketReader.Skip(Int64 count)
   at MySql.Data.MySqlClient.PacketReader.OpenPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetFieldMetaData41()
   at MySql.Data.MySqlClient.NativeDriver.GetFieldMetaData()
   at MySql.Data.MySqlClient.NativeDriver.ReadFieldMetadata(Int32 count, MySqlField[]& fields)
   at MySql.Data.MySqlClient.CommandResult.Load()
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
   at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection)
   at MySql.Data.MySqlClient.NativeDriver.Configure(MySqlConnection connection)
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
   at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at ADK.MySqlBase2.GiveMeDataSet(String SelectCommand) in h:\adk\software\adkheaderserver\base\sqllibrary\sqllibrary.cs:line 83
SELECT COUNT(*) FROM tblADKIndex WHERE subject = 'quasimodo post FTD # 476429 - Twee-Lachebekjes[34/87] - "Twee-Lachebekjes.r32" yEnc (16/17)' AND fromuser = 'YencADKminusKDAPoster@powerADKminusKDApost.org (YencADKminusKDAPPADKminusKDAAADKandKDAAADKcparKDA' AND filen = 'TweeADKminusKDALachebekjes.r32'


MySql.Data.MySqlClient.MySqlException: There is already an open DataReader associated with this Connection which must be closed first.
   at MySql.Data.MySqlClient.MySqlCommand.CheckState()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at ADK.MySqlBase2.GiveMeDataSet(String SelectCommand)


ignore those errors, threading it out fixed them all =]