Step 1 Create a web forms application Step 2: Create a Database After creating a new website, create a new database from server explorer of visual studio or SQL server.
We have shown you an example through visual studio 2010.
We will not get into more detailed explanation about the database but just a breif for undertsanding.
Database is a collection of data stored in a computer disc space or server space.
Displaying records on to grid view After opening up the sql connection, Let's write the Select statement in the sql command and the execute the sql query using sql command execute reader and append it to grid view data source as shown below.
Output Step 6 Inserting a new record using Insert Statement To add new record to the database we will use the following form that we have created in our file. Text are the form input name to take form input data.
Note: For numeric data we dont use (" ") inverted comma and for string data we use (" ") inverted comma .
Update Statement lets you to update existing one or more records in the database table depending on condition. Example "Where student ID = 1 " - It is a condition, means update student record whose ID number is = 1.
After creating a new database, let's add new data tables with colums like as shown in below image file.
Note : To create tables just click on your database name go to tables folder, when you choose to create a table it will ask you add columns.
There are commonly used databases in our IT Zone SQL - Microsoft SQL Server Oracle - Oracle RDBMS or simply as Oracle MYSQL - Open Source Freeware MSACESS - Microsoft Access Postgre SQL - ORDBMS SAP - To manage customer relationship and other business operations Fox Pro - Database IBM DB2 - IBM Database by IBM Now in further we will try to understand about data manipulation statements i.e. Select statement let you to retrieve the data from the database table.
For ex : In simple words if you want to pick up single student record, multiple student records or all students records from the table database you just need to use "Select" statement.
Step 5 Displaying records using select statement We will be display the records on grid view.