SQL (Structured Query Language) is a standard interactive and programming language for querying and modifying data and managing databases. Many might pronounce “SQL” as SEQUEL.
In this article I will cover how to create connection with your database and how to execute / run the SQL script from within your ASP.NET code.
Let’s create a simple Microsoft Access database.
Step 1. Open up Microsoft Access
Step 2. Select ‘New’ from ‘File’ menu
Step 3. Create a blank database and name it sampleDB.mdb (see ‘DB Screen Shot’)
Step 4. Double click on ‘Create table in design view’ to create your sample “Customer” table.
Step 5. Create fldID, fldName, fldAddress, fldPhone, fldActive fields. (See ‘Table Columns’ screen shot)
Step 6. Save the table name name it tblCustomer
Step 7. Now let’s add few customers to our tblCustomer table. (See ‘Table Data’ screen shot)
Now you have your first Access database “sampleDB.mdb”. Move this database file to your “App_Data” folder in your ASP.NET website project. Moving a database file in App_Data folder is much better than keeping it in any other folders. ASP.NETrecognizes the App_Data folder without specifying any path. If you have your database file in any other folder, then you would have to specify the path which is not always the best option.