Hey boys and girls,
I need help, I am working on a project that requires me to build a business tier (.dll) for a c# program, I've only ever used SQL server.
The problem comes in as follows, at university I was tuaght how to import a datasource via the wizzard. I cant do this with mySQL (Xampp, phpmyadmin) as im using the express version of VS 2010. Ok all that aside the problem:
I've written 2 example classes called Client.cs and ClientList.cs, I have succesfully read data via query from mySQL and saved it into a dataset for use in the presentation tier (under the default constructor of ClientList.cs).
I now need to write an update function, to either save or insert any changes made in the presentation tier datagrid...I have a few clues as to how I want to do it, just one function called Update, if there was changes to the row I need to just run query "Update", if a new row was added I want it to run Query "Insert".
Will it be best to return the whole dataset to the business tier and run a foreach loop with rowstate == unchanged, to see if a value was changed or a new row inserted? or is there a better way to do this?
Any help will be greatly appreciated.