ASP.NET: How to create an ASP.NET webpage and connect/manipulate a database. Guide/Tutorial/Walkthrough

This is done entirely using the GUI, and therefore requires little to no coding or database knowledge.

ASP.NET website created using VS2008, database is MS Access 2003 (AccessDB.mdb)

Lets Begin:
From within .NET Studio
-File -> New ->Web Page

Name your folder and click OK

Tab over to the Designer View

From the Toolbox locate the “Data” group and click and drag out SqlDataSource

Select the Arrow button at the upper right of your SqlDataSource -> click Configure ->New Connection

Click Browse find your access Database then click ok

Give it a name -> click Next

Within this screen you can configure your DataSource and generate custom queries using “WHERE” and “ORDER BY” buttons.  But for this demonstration a simple select will do.

In the Advanced Setting Check the “Generate INSERT, UPDATE, and DELETE statement” checkBox so you can write to the DB

Click next and test your query.

Click Finish.
Once your done configuring your DataSource. Grab a GirdView and Connect it to your DataSource

Click the Upper right arrow on your GridView Control. Then within the “Choose Data Source” dropdown you should see the SqlDataSource you have just created, select it.

Enable Paging, Sorting, Editing, Deleting, and Selection.

Click Crtl-s then Ctrl-F5   :)

Thats it!  Now your Website can  write to a DataBase.

Leave a Reply

Your email address will not be published.