hamid_14
دوشنبه 17 آذر 1399, 03:01 صبح
سلام
لطفا راهنمایی کنید مشکل این خطا چیه؟
unable to cast object of type "model" to type 'system.data.datarowview
مدل
public partial class FiscalYear {
public int EId { get; set; }
public string Description { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
public Nullable<int> Creator { get; set; }
public Nullable<System.DateTime> CreationDate { get; set; }
public Nullable<int> LastModifier { get; set; }
public Nullable<System.DateTime> LastModificationDate { get; set; }
}
کد
DataRowView currentrow = (DataRowView)Table1BindingSource.Current;
MessageBox.Show(currentrow["EId"].ToString());
لطفا راهنمایی کنید مشکل این خطا چیه؟
unable to cast object of type "model" to type 'system.data.datarowview
مدل
public partial class FiscalYear {
public int EId { get; set; }
public string Description { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
public Nullable<int> Creator { get; set; }
public Nullable<System.DateTime> CreationDate { get; set; }
public Nullable<int> LastModifier { get; set; }
public Nullable<System.DateTime> LastModificationDate { get; set; }
}
کد
DataRowView currentrow = (DataRowView)Table1BindingSource.Current;
MessageBox.Show(currentrow["EId"].ToString());