Đang chuẩn bị liên kết để tải về tài liệu:
Lecture E-Commerce - Chapter 24: ASP.NET (part III)

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Lecture E-Commerce - Chapter 25: ASP.NET MVC. In this chapter students will be able to: Introduction, MVC application, MVC folders, MVC layout, MVC controllers, MVC views, MVC database, MVC models. | CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad Virtual Campus, CIIT COMSATS Institute of Information Technology T2-Lecture-12 ASP.NET Part - III For Lecture Material/Slides Thanks to: www.w3schools.com ASP.NET Part III WebPages (Continued) Introduction to SQL Thank You Objectives WebPages Databases WebPages Helpers WebPages WebGrid WebPages Charts WebPages Email WebPages PHP WebPages Publish Introduction to SQL T2-Lecture-12 Ahmed Mumtaz Mustehsan www.w3schools.com 1- WebPages Databases Displaying Data from Database With Web Pages, data can easily be displayed from a database. Connect to an existing database, or create a new database from scratch. The following example will demonstrate to connect to an existing SQL Server Compact database. T2-Lecture-12 Ahmed Mumtaz Mustehsan www.w3schools.com 1- Displaying Data from Database @{ var db = Database.Open("SmallBakery"); var query = "SELECT * FROM Product"; } Small Bakery Products Id Product Description Price T2-Lecture-12 Ahmed Mumtaz Mustehsan www.w3schools.com 1- @foreach(var row in db.Query(query)) { @row.Id @row.Name @row.Description @row.Price } In the "DemoWebPages" folder, create a new CSHTML file named "Products.cshtml". Replace the code in the file with the code from the example below: Output of the above Example Id Product Description Price 1 Bread Baked fresh every day 2.99 2 Strawberry Cake Made with organic strawberries 9.99 3 Apple Pie Second only to your moms pie 12.99 4 Pecan Pie If you like pecans, this is for you 10.99 5 Lemon Pie Made with the best lemons in the world 11.99 6 Cupcakes Your kids will love these 9.99 T2-Lecture-12 Ahmed Mumtaz Mustehsan www.w3schools.com 1- Small Bakery Products Example Explained The Database.Open(name) method . | CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad Virtual Campus, CIIT COMSATS Institute of Information Technology T2-Lecture-12 ASP.NET Part - III For Lecture Material/Slides Thanks to: www.w3schools.com ASP.NET Part III WebPages (Continued) Introduction to SQL Thank You Objectives WebPages Databases WebPages Helpers WebPages WebGrid WebPages Charts WebPages Email WebPages PHP WebPages Publish Introduction to SQL T2-Lecture-12 Ahmed Mumtaz Mustehsan www.w3schools.com 1- WebPages Databases Displaying Data from Database With Web Pages, data can easily be displayed from a database. Connect to an existing database, or create a new database from scratch. The following example will demonstrate to connect to an existing SQL Server Compact database. T2-Lecture-12 Ahmed Mumtaz Mustehsan www.w3schools.com 1- Displaying Data from Database @{ var db = Database.Open("SmallBakery"); var query = "SELECT * FROM Product"; } Small Bakery .

TÀI LIỆU LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.