Microsoft ADO .NET 4 Step by Step - p 17

Lựa chọn báo cáo truy vấn SQL truy vấn dữ liệu trả về kết quả thao tác dữ liệu báo cáo số liệu báo cáo định nghĩa hỗ trợ các dữ liệu lưu trữ nội dung các thủ tục báo cáo rằng, sửa đổi hoặc thay đổi nội dung dữ liệu | In SQL Server databases the SQL language includes different types of statements including the following SQL query statements Selection queries that return data results Data manipulation statements Statements that modify or change data content Data definition statements Commands that modify tables and other structures that support the data content Stored procedures Named blocks of processing logic lets you process any of these statement types through instances of the System. class. This class encapsulates one or more SQL statements and includes methods that request processing of the statement s on a SQL Server connection optionally returning query results. Note In the OLE DB provider the equivalent command class is located at . whereas the ODBC provider version is found at . OdbcCommand. These two classes and the SqlCommand class in the SQL Server provider all derive from . Creating Command Objects Using the SqlCommand class is a straightforward procedure 1. Create an instance of SqlCommand. 2. Assign a valid SQL statement to the object s CommandText property. 3. Set the object s Connection property to an open SqlConnection instance. 4. Assign other optional properties as needed. 5. Call one of the object s many synchronous or asynchronous execute methods. The SqlCommand object s constructor has various overloaded versions that let you specify the SQL statement text and the connection as arguments. 136 Chapter 9 Querying Databases 137 C SqlConnection linkToDB new SqlConnection connectionString string sqlText @ UPDATE WorkTable SET ProcessedOn GETDATE WHERE ProcessedOn IS NULL SqlCommand dataAction new SqlCommand sqlText linkToDB Visual Basic Dim linkToDB As New SqlConnection connectionString Dim sqlText As String UPDATE WorkTable SET ProcessedOn GETDATE WHERE ProcessedOn IS NULL Dim dataAction As New SqlCommand sqlText .

Không thể tạo bản xem trước, hãy bấm tải xuống
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.