TAILIEUCHUNG - Beginning C# 2005 Databases PHẦN 3

Trên trang này, bạn chọn kiểu lệnh truy vấn cần thực hiện. Bạn có thể chọn: ❑ Sử dụng SQL cáo: Cho phép bạn tạo ra bất kỳ truy vấn SQL bạn có thể miễn là nó trả về hoặc không có kết quả hoặc kết quả duy nhất. Bạn cũng có thể cung cấp một truy vấn tham số mà bạn có thể vượt qua giá trị được sử dụng bởi các truy vấn (ví dụ như ID | Chapter 3 Figure 3-9 Choosing a query command type On this page you select the type of command that the query should execute. You can choose Use SQL Statements Enables you to create any SQL query you might like to as long as it returns either no result or a single result. You can also provide a parameterized query by which you can pass values to be used by the query such as the ID of a row to delete in a delete query . Create New Stored Procedure Similar to the preceding option but the SQL you enter is used to create a stored procedure that is then accessed directly by the Query item. These also can be parameterized. Use Existing Stored Procedure Creates a command that calls an existing stored procedure in the database parameterized or not. Care should be taken here to use a stored procedure that returns no results or a single value otherwise you cannot predict what you ll receive as a return value. For the first two options the next stage is to choose the type of SQL statement you are creating as shown in Figure 3-10. As you can see the only option unavailable is Select Which Returns Rows. You can however create any other type of SQL statement. The next step for a SQL command or stored procedure based on a SQL command is to enter the text of the command itself. You can either do that manually or use the SQL command builder which enables you to design queries graphically. If you want to parameterize your queries you can supply variable names in the form @ Variable Name 80 Viewing Data Figure 3-10 Choosing a query type For example you could make a query as follows SELECT Stringcolumn FROM MyTable WHERE MyTableld @MyTableId This would return the value for a single column in a single row where the row is identified by an ID value specified as a parameter called @MyTableId. If you are using an existing stored procedure you are presented with a drop-down selector from which to choose a stored procedure to use. Then you will see the parameters that will be generated and

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.