Lecture E-Commerce - Chapter 24: ASP.NET (part III)

Lecture E-Commerce - Chapter 25: 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 Part - III For Lecture Material/Slides Thanks to: 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 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 1- Displaying Data from Database @{ var db = ("SmallBakery"); var query = "SELECT * FROM Product"; } Small Bakery Products Id Product Description Price T2-Lecture-12 Ahmed Mumtaz Mustehsan 1- @foreach(var row in (query)) { @ @ @ @ } In the "DemoWebPages" folder, create a new CSHTML file named "". 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 Strawberry Cake Made with organic strawberries 3 Apple Pie Second only to your moms pie 4 Pecan Pie If you like pecans, this is for you 5 Lemon Pie Made with the best lemons in the world 6 Cupcakes Your kids will love these T2-Lecture-12 Ahmed Mumtaz Mustehsan 1- Small Bakery Products Example Explained The (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 Part - III For Lecture Material/Slides Thanks to: 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 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 1- Displaying Data from Database @{ var db = ("SmallBakery"); var query = "SELECT * FROM Product"; } Small Bakery .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.