Presentation is loading. Please wait.

Presentation is loading. Please wait.

Part 1 of 2 Creating SQL Database and Binding to GridView

Similar presentations


Presentation on theme: "Part 1 of 2 Creating SQL Database and Binding to GridView"— Presentation transcript:

1 Part 1 of 2 Creating SQL Database and Binding to GridView
Web Application with SQL ASP.Net 2.0 – Visual Studio 2005 CSE686 – Internet Programming Instructor: James W. Fawcett TA: Murat K. Gungor Summer 2006 Part 1 of 2 Creating SQL Database and Binding to GridView

2 Create – New - Web Site MS Visual Studio 2005

3 Empty Web Site – C# Name it OnlinePhoneBook

4 Add New Web Form

5 Test your empty web site
Hit Ctrl+F5 to make sure it runs Set Default.aspx “As Start Page”

6 Add SQL Server Database File
Using Server Explorer Add SQL Server Database File

7 PhoneBookDB.mdf will be created for us
Type PhoneBookDB YES PhoneBookDB.mdf will be created for us

8 Add Data Field names and Types
1 Right Click and Choose - Add New Table - 2 Add Data Field names and Types 3 Hit Save Button And Name it PhoneBookTable Hit OK

9 And Enter some information
2 Add some data 1 Right Click Choose Show Table Data And Enter some information

10 Hit arrow at upper right corner choose data source
Drag and Drop GridView to Default.aspx Hit arrow at upper right corner choose data source <New data source…>

11 Pick Defaults and Hit OK
Choose Database Pick Defaults and Hit OK

12 Configure Data Source Select

13 Save the Connection String
Hit Next

14 Test Query

15 Lets Run it

16 Lets look at little bit code
Default.aspx

17 Web.config PhoneBookDBConnectionString

18 End of Part 1 We have seen Part 2 shows how to
How to Create SQL Database Binding Database to GridView Part 2 shows how to Add Remove Edit


Download ppt "Part 1 of 2 Creating SQL Database and Binding to GridView"

Similar presentations


Ads by Google