TAILIEUCHUNG - Pass a Dataset Back from an XML Web Service

13,4 Pass một Dataset Quay lại từ một XML Web Service Tôi muốn để có thể nhận được nhiều dữ liệu hơn so với giá trị một chỉ duy nhất. Làm thế nào để lấy toàn bộ dữ liệu từ một dịch vụ Web? | Pass a Dataset Back from an XML Web Service I want to be able to get more data than just a single value. How do I retrieve a whole dataset from a Web Service Technique When you need to pass back a record or multiple records from a Web Service you have to pass it back as a DataSet object rather than a DataTable object. For this How-To you will pass back the record of the user who is requested. Before returning the record however the code removes the Password column. You don t particularly want that information going out over the Net see Listing . Listing Passing Back a DataSet Object WebMethod Public Function GetUserInfo ByVal strUserlD As String As DataSet Dim ocnn As New Provider Data Source E InetPub wwwroot SecurityWebService Dim odaUsers As New _ Select from tblUsers Where UserID strUserID . ocnn Dim dsUsers As New DataSet dsUsers -- remove the password column 0 . Password Return dsUsers End Function Note Although you could limit the SELECT string to only return the necessary columns and not have to delete the Password column there are two reasons for coding it the way it was done. 1. It shows how to delete columns from a data table. 2. If the goal is to include all the columns in the table and accept the Password column then when other columns are added you will not have to touch the code because the is being used. Tip When referring to tables on the receiving end as displayed in step 2 of this How-To you have to refer to tables in the dataset by their ordinal values. Therefore some information in the description of the Web Service method about the dataset might be warranted. Steps To preview this How-To open the solution called Visual Basic .NET-Chapter 13 found in this chapter s folder. On the main form click on the button labeled How-To . The form for How-To then opens. If you

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.