![Phân tích tư tưởng của nhân dân qua đoạn thơ: Những người vợ nhớ chồng… Những cuộc đời đã hóa sông núi ta trong Đất nước của Nguyễn Khoa Điềm](https://timtailieu.net/upload/document/136415/phan-tich-tu-tuong-cua-nhan-dan-qua-doan-tho-039-039-nhung-nguoi-vo-nho-chong-nhung-cuoc-doi-da-hoa-song-nui-ta-039-039-trong-dat-nuoc-cua-nguyen-khoa-136415.jpg)
Creating a Sqldatareader Objec
Số trang: 1
Loại file: pdf
Dung lượng: 11.00 KB
Lượt xem: 14
Lượt tải: 0
Xem trước 1 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Creating a SqlDataReader Object You can create a DataReader object only by calling the ExecuteReader() method of a Command object. Command objects were covered in the previous chapter.
Nội dung trích xuất từ tài liệu:
Creating a Sqldatareader ObjecCreating a SqlDataReader ObjectYou can create a DataReader object only by calling the ExecuteReader() method of aCommand object. Command objects were covered in the previous chapter. For example,the following code creates the required objects and executes a SELECT statement thatretrieves the top five rows from the Products table of the SQL Server Northwinddatabase, storing the returned rows in a SqlDataReader object:SqlConnection mySqlConnection = new SqlConnection( server=localhost;database=Northwind;uid=sa;pwd=sa );SqlCommand mySqlCommand = mySqlConnection.CreateCommand();mySqlCommand.CommandText = SELECT TOP 5 ProductID, ProductName, UnitPrice, + UnitsInStock, Discontinued + FROM Products + ORDER BY ProductID;mySqlConnection.Open();SqlDataReader productsSqlDataReader = mySqlCommand.ExecuteReader();Notice that the SqlDataReader object returned by the ExecuteReader() method is storedin the productsSqlDataReader object. Youll see how to use productsSqlDataReader inthe following section.
Nội dung trích xuất từ tài liệu:
Creating a Sqldatareader ObjecCreating a SqlDataReader ObjectYou can create a DataReader object only by calling the ExecuteReader() method of aCommand object. Command objects were covered in the previous chapter. For example,the following code creates the required objects and executes a SELECT statement thatretrieves the top five rows from the Products table of the SQL Server Northwinddatabase, storing the returned rows in a SqlDataReader object:SqlConnection mySqlConnection = new SqlConnection( server=localhost;database=Northwind;uid=sa;pwd=sa );SqlCommand mySqlCommand = mySqlConnection.CreateCommand();mySqlCommand.CommandText = SELECT TOP 5 ProductID, ProductName, UnitPrice, + UnitsInStock, Discontinued + FROM Products + ORDER BY ProductID;mySqlConnection.Open();SqlDataReader productsSqlDataReader = mySqlCommand.ExecuteReader();Notice that the SqlDataReader object returned by the ExecuteReader() method is storedin the productsSqlDataReader object. Youll see how to use productsSqlDataReader inthe following section.
Tìm kiếm theo từ khóa liên quan:
kĩ thuật lập trình công nghệ thông tin lập trình ngôn ngữ lập trình C Shark C# sybex - c.sharp database programming Creating a Sqldatareader ObjecTài liệu liên quan:
-
52 trang 439 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 329 0 0 -
74 trang 309 0 0
-
96 trang 305 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 299 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 291 0 0 -
Tài liệu dạy học môn Tin học trong chương trình đào tạo trình độ cao đẳng
348 trang 291 1 0 -
Giáo trình Lập trình hướng đối tượng: Phần 2
154 trang 282 0 0 -
Kỹ thuật lập trình trên Visual Basic 2005
148 trang 279 0 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 278 0 0