A
Aaron
Environment Information:
I am running Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) and
connecting to a SQL Server 2005 database, although this problem never reaches
the database. I am also using Windows XP Professional SP 2.
My problem is that when I call the EndEdit() method for my BindingSource, I
recieve the following error:
System.ArgumentNullException: Value cannot be null.
Parameter name: key
Stack Trace: at
System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at System.Data.DataView.MaintainDataView(ListChangedType changedType,
DataRow row, Boolean trackAddRemove)
at System.Data.DataViewListener.MaintainDataView(ListChangedType
changedType, DataRow row, Boolean trackAddRemove)
at
System.Data.Index.<>c__DisplayClass5.<MaintainDataView>b__4(DataViewListener
listener, ListChangedType type, DataRow row, Boolean track)
at System.Data.Listeners`1.Notify[T1,T2,T3](T1 arg1, T2 arg2, T3 arg3,
Action`4 action)
at System.Data.Index.MaintainDataView(ListChangedType changedType, Int32
record, Boolean trackAddRemove)
at System.Data.Index.InsertRecord(Int32 record, Boolean fireEvent)
at System.Data.Index.ApplyChangeAction(Int32 record, Int32 action, Int32
changeRecord)
at System.Data.DataTable.RecordStateChanged(Int32 record1,
DataViewRowState oldState1, DataViewRowState newState1, Int32 record2,
DataViewRowState oldState2, DataViewRowState newState2)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32
proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position,
Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32
pos, Boolean fireEvent)
at System.Data.DataView.FinishAddNew(Boolean success)
at System.Data.DataRowView.EndEdit()
at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
at System.Windows.Forms.BindingSource.EndEdit()
There is a BindingNavigator and DateTimePicker control bound to the
BindingSource. The BindingSource is bound to a TableAdapter on a DataSet.
The DateTimePicker is not likely to be a part of the problem because I also
tried replacing it with a regular TextBox and the error still occurred.
This problem occurs randomly. The application passed all testing and the
error did not appear until the application was deployed. The error happens
more often than not, but it does not always happen even using the EXACT same
steps to create the issue.
Please help! If you would like more details on how specific objects are
bound, please let me know.
Thanks!
I am running Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) and
connecting to a SQL Server 2005 database, although this problem never reaches
the database. I am also using Windows XP Professional SP 2.
My problem is that when I call the EndEdit() method for my BindingSource, I
recieve the following error:
System.ArgumentNullException: Value cannot be null.
Parameter name: key
Stack Trace: at
System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at System.Data.DataView.MaintainDataView(ListChangedType changedType,
DataRow row, Boolean trackAddRemove)
at System.Data.DataViewListener.MaintainDataView(ListChangedType
changedType, DataRow row, Boolean trackAddRemove)
at
System.Data.Index.<>c__DisplayClass5.<MaintainDataView>b__4(DataViewListener
listener, ListChangedType type, DataRow row, Boolean track)
at System.Data.Listeners`1.Notify[T1,T2,T3](T1 arg1, T2 arg2, T3 arg3,
Action`4 action)
at System.Data.Index.MaintainDataView(ListChangedType changedType, Int32
record, Boolean trackAddRemove)
at System.Data.Index.InsertRecord(Int32 record, Boolean fireEvent)
at System.Data.Index.ApplyChangeAction(Int32 record, Int32 action, Int32
changeRecord)
at System.Data.DataTable.RecordStateChanged(Int32 record1,
DataViewRowState oldState1, DataViewRowState newState1, Int32 record2,
DataViewRowState oldState2, DataViewRowState newState2)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32
proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position,
Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32
pos, Boolean fireEvent)
at System.Data.DataView.FinishAddNew(Boolean success)
at System.Data.DataRowView.EndEdit()
at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
at System.Windows.Forms.BindingSource.EndEdit()
There is a BindingNavigator and DateTimePicker control bound to the
BindingSource. The BindingSource is bound to a TableAdapter on a DataSet.
The DateTimePicker is not likely to be a part of the problem because I also
tried replacing it with a regular TextBox and the error still occurred.
This problem occurs randomly. The application passed all testing and the
error did not appear until the application was deployed. The error happens
more often than not, but it does not always happen even using the EXACT same
steps to create the issue.
Please help! If you would like more details on how specific objects are
bound, please let me know.
Thanks!