Professional ASP.NET 1.0 Special Edition- P19

Professional Special Edition- P19:Those of us who are Microsoft developers can't help but notice that .NET has received a fair amount of visibility over the last year or so. This is quite surprising considering that for most of this period, .NET has been in its early infancy and beta versions. I can't remember any unreleased product that has caused this much interest among developers. And that's really an important point, because ignoring all the hype and press, .NET really is a product for developers, providing a great foundation for building all types of applications | create connection and command to access database Dim objConnect As New OleDbConnection strConnect Dim objCommand As New OleDbCommand strSQL objConnect declare the variables we ll need Dim objReader As OleDbDataReader Dim strValues As String Dim intIndex As Integer Try get a DataReader containing the specified row data objReader put values from row into a string to return If Then For intIndex 0 To - 1 strValues intlndex Next End If close connection and return result GetUnderlyingValues Left strValues Len strValues - 2 Catch objError As Exception GetUnderlyingValues Error End Try End Function Summary This chapter has been devoted entirely to the often-thorny problems we encounter when updating a relational data source such as a SQL database from within our applications. While the techniques have focused on using the .NET data access classes with a relational database bear in mind that the connection between our code and the data store is via standard methods such as OLE-DB and ODBC. This means that as new managed providers become available we can use the same techniques to work with other data stores such as mail servers active directory indexing services etc. The chapter began with a look at the techniques we often use to perform single operations against a data store - such as inserting a user s name and e-mail address into a database or deleting rows in response to a user s input. We demonstrated how to do this with both SQL statements and with stored procedures. We also looked at how we can use transactions to provide better data integrity. We used both database transactions and .NET connection-based transactions. However the main focus of the chapter was on how we use the new DataSet object to store and then update data in a disconnected environment. We saw how we can use the Update method of the DataAdapter to push updates into a data store .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
34    76    1    14-05-2024
Đã 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.