rowlandsfc
Active member
hi i have an application that displays customers accounts in one table and products information which includes the interest rate for that specific product in another table, both tables get displayed inside a datagridview. for my accounts database there is an accrued column which i need to code so that it updates each day. i have it set up so that total days between start of the financial year and now is calculated and stored in a variable called days., im not really sure where to start when it comes to going through the datagridview to do all the calculations to for accrued then add it back into the database. i have a method set up to check a variable for a productid to find out what interest rate to use when doing the calculations. my first thought was to run through the datagridview row by row and take out the productid then run the method and dothe calculationsfor accrued and then update the datbase before moving onto the next row. but when i run the code i get 'Object reference not set to an instance of an object.'
im stuck as to where to go from here, any help would be appreciated thanks
foreach loop:
foreach (DataGridViewRow accrued in dgv_Account.Rows)
{
Global.productID = accrued.Cells[2].Value.ToString();
}
im stuck as to where to go from here, any help would be appreciated thanks