How to: Database

Database Basics: Using Oracle

A database is the most common way to store vast amounts of data. In theory a developer could just update a website with HTML and CSS to display information. In practice, this is quite rare as developers make websites for those who are not. Storing information in a database allows nondevelopers to manipulate the website without a developer. The developer is required to set up the website and database so that the nondeveloper can operate their website.

There are four distinct features of a database that allow a website to be interactive and accessible to all levels of users: create, read, update, and delete (CRUD). Databases allow users to create data to be stored into a database. When you are registering for a mailing list, you are inserting a row into the database with your information. Users can read the contents of a database. When you're shopping online or an admin is looking at their list of users, you are viewing the results of SELECT statements of database contents. Updating your information should be readily available should information change. When you are editing your profile on a website, you are executing UPDATE statments behind the scenes. Finally, databases allow users to delete information. If you've deleted a profile in the past, the database is using DELETE statements to remove those rows. Not all organizations do this, though. Facebook gives you the option to "reactivate" your account. That likely means that Facebook does not delete your profile's row in the database, but rather just changes a field to "inactive" so your information is retained for anaylsis and recovery.

Before you continue, I recommend reviewing a good amount of SQL commands as it will not be covered here. You may also want Oracle SQL developer open for the duration.

Download the necessary software

Each new web project in Visual Studio cannot readily connect to an Oracle database without the required software. To download this sofware, go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution. This opens up the NuGet Package Manager. Select Browse then type in "Oracle" in the search box. Select Oracle.ManagedDataAccess and apply it to your project for installation.

Download oracle client for visual studio

You now have the necessary references for C# to interact with a Oracle database.