TAILIEUCHUNG - ASP.NET 2.0 Everyday Apps For Dumies 2006 phần 9

Tham khảo tài liệu ' everyday apps for dumies 2006 phần 9', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 10 Building a Web Forum 347 EventArgs e string con WebConfigurationManager 5 .ConnectionStrings ForumConnectionString .Connectionstring ds new DataSet 6 fill the Forums table 7 string sel SELECT forumid name FROM Forums ORDER BY name SqlDataAdapter da new SqlDataAdapter sel con ds Forums fill the Topics table 8 sel SELECT forumid topicid name description FROM Topics ORDER bY name da new SqlDataAdapter sel con ds Topics bind the Forum repeater 9 Forums .Defaultview public void ForumRepeater_ItemDataBound 10 Object sender RepeaterltemEventArgs e Repeater r Repeater 11 .FindControl TopicRepeater DataRowView drv 12 DataRowView string forumid drv forumid .ToString DataView dv 13 Topics .DefaultView forumid forumid dv 14 348 Part V Building Community Applications Here s a set of 14 explanations matched to the 14 key lines of this listing 1 The code-behind file needs access to the . Configuration namespace because it uses the WebConfigurationManager class to retrieve the database connection string from the file. 2 The namespace is required to use classes such as DataSet SqlConnection and SqlCommand. 3 This line defines a class instance variable of type DataSet. That way the dataset will be available to both of the methods in the code-behind file. 4 The Page_Load method executes when the page loads. It fills the dataset with data retrieved from the Forums and Topics tables it also sets up data binding for the ForumRepeater control and calls that control s DataBind method which completes the binding. 5 This line retrieves the connection string from the file. 6 This statement creates an empty dataset object and assigns it to the ds variable. 7 These lines create a table in the ds dataset named Forums by a creating a data

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.