Всем привет
Такой код работает в VS2008, но отказывается работать в VS2005
Если кто подскажет почему буду премного благодарен
// Insert Master/Detail;
private void toolStripButtonSave_Click(object sender, EventArgs e)
{
this.Validate();
this.masterBindingSource.EndEdit();
this.masterTableAdapter.Update(this.mainDataSet.Master);
MainDataSet.MasterRow _RowMaster = getCurrentMaster();
if (_RowMaster != null)
{
foreach (MainDataSet.DetailRow _RowDetail in this.mainDataSet.Detail)
{
if (_RowDetail.master_id < 1)
{
_RowDetail.master_id = _RowMaster.id;
}
}
}
// VS2005 ПУСТО; VS2008 новая строка есть
this.detailBindingSource.EndEdit();
// VS2005 новое значение master_id есть; VS2008 аналогично
this.detailTableAdapter.Update(this.mainDataSet.Detail);
// VS2005 новое значение потерялось и в базе master_id "0" и в датасете;
// VS2008 все ок новое значение master_id и в базе и в датасете
}
Николай