Presentation is loading. Please wait.

Presentation is loading. Please wait.

Financial Information Management Changing data in a DB Stefano Grazioli.

Similar presentations


Presentation on theme: "Financial Information Management Changing data in a DB Stefano Grazioli."— Presentation transcript:

1 Financial Information Management Changing data in a DB Stefano Grazioli

2 Critical Thinking  Easy meter

3 Financial Information Management Ado.net Inserts, Deletes, and Updates: ‘non-queries’

4 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

5 ADO.NET for non-queries Remote DataBase Client (your program on your machine) SQL Query string Connection string SqlConnection DB Server SqlCommand Execution Feedback

6 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)

7 Financial Information Management Demo

8 You do the talking  Name, Major  Learning objectives  Things you like about the class  Things that can be improved  Strengths / Attitude towards the Tournament

9 Financial Information Management Homework

10  Make sure that you understand the ADO architecture diagrams before coding.

11 Financial Information Management WINIT What Is New In Technology?

12 Financial Information Management Best Practices Try/Catch

13 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

14 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

15


Download ppt "Financial Information Management Changing data in a DB Stefano Grazioli."

Similar presentations


Ads by Google