Financial Information Management Changing data in a DB Stefano Grazioli
Critical Thinking Easy meter
Financial Information Management Ado.net Inserts, Deletes, and Updates: ‘non-queries’
ADO.NET architecture Remote DataBase Client (your program on your machine) SQL Query string Connection string SqlConnection SqlAdapter Your objects (e.g. ListObject) DataSet DataTable s DataRow s DB Server SqlCommand
ADO.NET for non-queries Remote DataBase Client (your program on your machine) SQL Query string Connection string SqlConnection DB Server SqlCommand Execution Feedback
String.Format -- insert into Customer2 (C_id, F_name, L_name, City, State) -- values ('C0992','Max', 'Plank', 'Roanoke', 'VA') newCId = Range("K2").Value newFName = Range("K3").Value newLName = Range("K4").Value newCity = Range("K5").Value newState = Range("K6").Value sqlString As String = String.Format( "insert into Customer2 (C_id, F_name, L_name, City, State) values ('{0}','{1}','{2}','{3}','{4}')", newCId, newFName, newLName, newCity, newState)
Financial Information Management Demo
You do the talking Name, Major Learning objectives Things you like about the class Things that can be improved Strengths / Attitude towards the Tournament
Financial Information Management Homework
Make sure that you understand the ADO architecture diagrams before coding.
Financial Information Management WINIT What Is New In Technology?
Financial Information Management Best Practices Try/Catch
Example try-catch Try myConnection.Open() ‘… there might be more statements Catch MessageBox.Show("Ouch! I have just crashed. “, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Try This will be tried This will run only if something goes wrong while trying
A Mixed Blessing While developing an algorithm, crashes are often very informative Bad idea to use try/catches as part of an algorithm Put the try/catches in as a last step, after testing