Hello,
I've a simple problem which I can't solve. In my C# Office application, the user can input a username and password. After he has saved the data he will be able to change the values.
This is where it goes wrong.
At this line drUpdate[2] = txtUsername.Text.ToString(); the system goed to the catch section and this is the stacktrace in Telerik.Wincontrols.UI.
at Telerik.WinControls.UI.SelfReferenceDataBinding.UpdateItem(Int32 index)
at Telerik.WinControls.UI.SelfReferenceDataBinding.dataManager_ListChanged(Object sender, ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
at System.Data.DataView.OnListChanged(ListChangedEventArgs e)
at System.Data.DataView.IndexListChanged(Object sender, ListChangedEventArgs e)
at System.Data.DataView.IndexListChangedInternal(ListChangedEventArgs e)
at System.Data.DataViewListener.IndexListChanged(ListChangedEventArgs e)
at System.Data.Index.<OnListChanged>b__2(DataViewListener listener, ListChangedEventArgs args, Boolean arg2, Boolean arg3)
at System.Data.Listeners`1.Notify[T1,T2,T3](T1 arg1, T2 arg2, T3 arg3, Action`4 action)
at System.Data.Index.OnListChanged(ListChangedEventArgs e)
at System.Data.Index.OnListChanged(ListChangedType changedType, Int32 newIndex, Int32 oldIndex)
at System.Data.Index.RecordStateChanged(Int32 oldRecord, DataViewRowState oldOldState, DataViewRowState oldNewState, Int32 newRecord, DataViewRowState newOldState, DataViewRowState newNewState)
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.SetNewRecord(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean fireEvent)
at System.Data.DataRow.SetNewRecord(Int32 record)
at System.Data.DataRow.EndEdit()
at System.Data.DataRow.set_Item(DataColumn column, Object value)
at System.Data.DataRow.set_Item(Int32 columnIndex, Object value)
at WordAddIn.SaveForm.btnChangePlatformOk_Click(Object sender, EventArgs e) in C:\.NET Projecten\Word Add-in\WordAddIn\WordAddIn\FormSave\SaveForm.cs:line 634
Does anybody knows what the cause is for this error, I'm trying to solve it for 2 hours, but can't find why "Object reference not set to an instance of an object is showing"...
I've a simple problem which I can't solve. In my C# Office application, the user can input a username and password. After he has saved the data he will be able to change the values.
This is where it goes wrong.
try
{
DataRow[] platformRow = dsPlatformsxml.Tables[0].Select(
"ID = '"
+txtID.Text.ToString()+
"'"
);
DataRow drUpdate = platformRow[0];
drUpdate[2] = txtUsername.Text.ToString();
}
catch
(Exception ex)
{
string
test = ex.Message;
}
At this line drUpdate[2] = txtUsername.Text.ToString(); the system goed to the catch section and this is the stacktrace in Telerik.Wincontrols.UI.
at Telerik.WinControls.UI.SelfReferenceDataBinding.UpdateItem(Int32 index)
at Telerik.WinControls.UI.SelfReferenceDataBinding.dataManager_ListChanged(Object sender, ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
at System.Data.DataView.OnListChanged(ListChangedEventArgs e)
at System.Data.DataView.IndexListChanged(Object sender, ListChangedEventArgs e)
at System.Data.DataView.IndexListChangedInternal(ListChangedEventArgs e)
at System.Data.DataViewListener.IndexListChanged(ListChangedEventArgs e)
at System.Data.Index.<OnListChanged>b__2(DataViewListener listener, ListChangedEventArgs args, Boolean arg2, Boolean arg3)
at System.Data.Listeners`1.Notify[T1,T2,T3](T1 arg1, T2 arg2, T3 arg3, Action`4 action)
at System.Data.Index.OnListChanged(ListChangedEventArgs e)
at System.Data.Index.OnListChanged(ListChangedType changedType, Int32 newIndex, Int32 oldIndex)
at System.Data.Index.RecordStateChanged(Int32 oldRecord, DataViewRowState oldOldState, DataViewRowState oldNewState, Int32 newRecord, DataViewRowState newOldState, DataViewRowState newNewState)
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.SetNewRecord(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean fireEvent)
at System.Data.DataRow.SetNewRecord(Int32 record)
at System.Data.DataRow.EndEdit()
at System.Data.DataRow.set_Item(DataColumn column, Object value)
at System.Data.DataRow.set_Item(Int32 columnIndex, Object value)
at WordAddIn.SaveForm.btnChangePlatformOk_Click(Object sender, EventArgs e) in C:\.NET Projecten\Word Add-in\WordAddIn\WordAddIn\FormSave\SaveForm.cs:line 634
Does anybody knows what the cause is for this error, I'm trying to solve it for 2 hours, but can't find why "Object reference not set to an instance of an object is showing"...