TAILIEUCHUNG - Mapping .NET Data Provider Data Types to .NET Framework Data Types

[ Team LiB ] Recipe Mapping .NET Data Provider Data Types to .NET Framework Data Types Problem You want to convert between .NET provider data types and .NET Framework data types. Solution You need to understand the .NET Framework data types; their mappings to SQL Server, OLE DB, ODBC | Team LiB Recipe Mapping .NET Data Provider Data Types to .NET Framework Data Types Problem You want to convert between .NET provider data types and .NET Framework data types. Solution You need to understand the .NET Framework data types their mappings to SQL Server OLE DB ODBC and Oracle data types and how to properly cast them. The .NET Framework typed accessors and .NET Framework provider-specific typed accessors for use with the DataReader class are also important. Discussion The DataSet and contained objects are data source independent. The DataAdapter is used to retrieve data into the DataSet and to reconcile modifications made to the data to the data source at some later time. The implication is that data in the DataTable objects contained in the DataSet are .NET Framework data types rather than data types specific to the underlying data source or the .NET data provider used to connect to that data source. While the DataReader object for a data source is specific to the .NET data provider used to retrieve the data the values in the DataReader are stored in variables with .NET Framework data types. The .NET Framework data type is inferred from the .NET data provider used to fill the DataSet or build the DataReader. The DataReader has typed accessor methods that improve performance by returning a value as a specific .NET Framework data type when the data type is known thereby eliminating the need for additional type conversion. For more information about using typed accessors with a DataReader see Recipe . Some DataReader classes expose data source specific accessor methods as well. For example the SqlDataReader exposes accessor methods that return SQL Server data types as objects of . The following example shows how to cast a value from a DataReader to a .NET Framework data type and how to use the .NET Framework typed accessor and the SQL Server-specific typed accessor Create the connection and the command. SqlConnection conn

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.