I’m creating a backend for one of webpage. The backend is a Windows Form in C#.
I have a Business Object PaymentExpected:
public class PaymentExpected
{
public int ID { get; set; }
public int JoiningID { get; set; }
public int AccountID { get; set; }
.....
public List<PaymentExpected> Load_All()
{
....
}
And to fill my DataGridView I just do:
DG_View.DataSource = paymentExpected.Load_All();
now I want updates to be saved once the “Update” Button is clicked, But I dont want to use a SQL adapter as I use business objects.
So I need some way of getting the changes and calling the update. (Which I would normally update like this:)
paymentExpected.ID = 1;
paymentExpected.JoiningID = 1;
paymentExpected.AccountID = 1;
paymentExpected.Save();
But I am unsure of how to do that with the datagridview?
Why can’t you just keep a reference to the “paymentsExpected.Load_All()” data source in the code-behind and call paymentExpected.Save() from the button click event?