C# 链接MYSQL数据库。用的MySql.Data.dll 这样的DLL。最近比较频繁的出这样的错误,还时出时不出。求教各位达人。System.ArgumentException: 源数组长度不足。请检查 srcIndex 和长度以及数组的下限。
在 System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
在 System.Collections.Generic.Queue`1.SetCapacity(Int32 capacity)
在 System.Collections.Generic.Queue`1.Enqueue(T item)
在 MySql.Data.MySqlClient.ProcedureCache.AddNew(MySqlConnection connection, String spName)
在 MySql.Data.MySqlClient.ProcedureCache.GetProcedure(MySqlConnection conn, String spName)
在 MySql.Data.MySqlClient.StoredProcedure.GetParameters(String procName)
在 MySql.Data.MySqlClient.StoredProcedure.Resolve()
在 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
在 MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
在 DBModule.SqlHelper.ExecuteNonQuery(MySqlTransaction transaction, CommandType commandType, String commandText, MySqlParameter[] commandParameters)
在 DBModule.TestModule.Test_Insert.AddTEst(MySqlTransaction transaction, Int32 intType, Int64 longAccountID)
在 BusinessHandler.TestHandler.TestItem.AddTest(MySqlTransaction transaction, Int32 intType, Int64 longAccountID)
在 System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
在 System.Collections.Generic.Queue`1.SetCapacity(Int32 capacity)
在 System.Collections.Generic.Queue`1.Enqueue(T item)
在 MySql.Data.MySqlClient.ProcedureCache.AddNew(MySqlConnection connection, String spName)
在 MySql.Data.MySqlClient.ProcedureCache.GetProcedure(MySqlConnection conn, String spName)
在 MySql.Data.MySqlClient.StoredProcedure.GetParameters(String procName)
在 MySql.Data.MySqlClient.StoredProcedure.Resolve()
在 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
在 MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
在 DBModule.SqlHelper.ExecuteNonQuery(MySqlTransaction transaction, CommandType commandType, String commandText, MySqlParameter[] commandParameters)
在 DBModule.TestModule.Test_Insert.AddTEst(MySqlTransaction transaction, Int32 intType, Int64 longAccountID)
在 BusinessHandler.TestHandler.TestItem.AddTest(MySqlTransaction transaction, Int32 intType, Int64 longAccountID)
红色部分代码是说从sourceArray哪儿开始复制,这个值必须小于sourceArray的长度,否则就报你那个错了。
应该改的是Mysql.Data.dll吧?问题是这是个封装好的DLL哇