Académique Documents
Professionnel Documents
Culture Documents
Presentation
Databases
Consistency can work with multiple data sources consistently thus providing
consistent access to data sources such as Ms SQL Server and any data sources
exposed via OLEDB. Includes inherent support for XML data sets
Powerful object model provides object model with database features
N-tier (involves developing separate levels of application) programming
presentation, business logic, data access and storage tier that work together to
provide a complete user experience
XML Support to access data in a standard way, XML serves to encode and format
data into a standards-complaint format. XML class framework enables you to cross
between the two libraries easily.
Disconnected Record Sets its major functionality is on disconnected data
Object model-Recreates all functionality present in database system
Steps to connect to a database
using VB.Net
After launching MS VB, select create object
Select Windows Form application from the templates and give a database name
Click on data on the menu bar and add new data source
In the data source toolbar, click and add new data sources
Select database from the configuration wizard and choose next.
Whilst in the wizard click new connection and select a data source
In the next window of the wizard browse your database file name
Select the tables you want to view and select finish and save the project
Select tools connect to database
Select a server name and the database name in the add connection dialog box
Click on the test connection button to check if the connection has succeeded
SQL Statements
Defining How Your Data Is Stored
SELECT is used when you want to read (or select) your data.
INSERT is used when you want to add (or insert) new data.
UPDATE is used when you want to change (or update) existing data.
DELETE is used when you want to remove (or delete) existing data.
REPLACE is used when you want to add or change (or replace) new or existing
data.
TRUNCATE is used when you want to empty (or delete) all data from the
template
Transactions
This is an obvious step but a tricky one, sometimes a bad identification of an error can cause lots
of wasted developing time. It is usual that production errors reported by users are hard to be
interpreted and sometimes the information we are getting from them is misleading.
See the error. This is easy if you spot the error, it usually comes as a message or a pop up
message
Reproduce the error. You never should say that an error has been fixed if you were not able to
reproduce it.
Understand what the expected behaviour should be. In complex applications this could be hard
to tell what should be the expected behaviour of an error, but that knowledge is basic to be able
to fix the problem.
Validate the identification. Confirm with the responsible of the application that the error is
actually an error and that the expected behaviour is correct. The validation can also lead to
situations where it is not necessary or not worth it to fix the error.
Step 2: Find the error.
Once we have an error correctly identified, its time to go through the code to find the
exact spot where the error is located. A few techniques that may help to find an error are:
Logging. It can be to the console file which should help you to trace the error in the code.
Debugging. Debugging in the most technical sense of the word, meaning turning on
whatever the debugger you are using and stepping through the code.
Removing code. For example you could take out half of the code from the action causing
the machine to crash, and execute it hundreds of times, and if the application continues to
crash, do the same with the other half of the code, it MIGHT stop crushing, in that case we
can say that the error was on the first half if not you may keep splitting the code until you
find where the error is. It could be from a third party function.
Step 3:Analyze the error.
This is a critical step, use a bottom-up approach from the place the error was
found and analyse the code so you can see the big picture of the error,
analysing a bug has two main goals: to check that around that error there arent
any other errors to be found (the iceberg metaphor), and to make sure what are
the risks of entering any collateral damage in the fix.
Step 4: Prove your analysis
This is a straight forward step, after analysing the original bug you may have
come with a few more errors that may appear on the application, this step its
all about writing automated tests for these areas.
Once you have your tests, you can run them and you should see all them failing,
that proves that your analysis is right.
Step 5. Cover lateral damage.
At this stage you are almost ready to start coding the fix, but you have to
cover up before you change the code, so you create or gather (if already
created) all the unit tests for the code which is around where you will do
the changes so that you will be sure after completing the modification that
you wont have to break anything else. If you run this unit tests, they all
should pass.
Step 6. Fix the error
Run all the test scripts and check that they all pass.
Thank you !!!!!