TAILIEUCHUNG - Deserializing Data

Team LiB ] Recipe Deserializing Data Problem You have a DataSet that has been serialized and written to a file. You want to recreate the DataSet from this file. Solution Use the serializer object's Deserialize( ) method and cast the result as a DataSet | Team LiB Recipe Deserializing Data Problem You have a DataSet that has been serialized and written to a file. You want to recreate the DataSet from this file. Solution Use the serializer object s Deserialize method and cast the result as a DataSet. The sample code loads a file stream containing a previously serialized DataSet in a specified format and deserializes it to recreate the original DataSet. The C code is shown in Example 5-5. Example 5-5. File Namespaces variables and constants using System using using using using using System . using using using private OpenFileDialog ofd . . . private void goButton_Click object sender e Create and open the stream for deserializing. Stream stream null try stream catch Exception ex Deserializing Data return Deserialize the DataSet from the stream. DataSet ds null try if ds new DataSet stream else if XmlSerializer xs new XmlSerializer typeof DataSet ds DataSet stream else if SoapFormatter sf new SoapFormatter ds DataSet stream else if BinaryFormatter bf new BinaryFormatter ds DataSet stream catch ex Deserializing Data return finally Bind the DataSet to the grid. Deserialization complete. Deserializing Data private void fileDialogButton_Click object sender e

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.