Ngược lại, phần 6-chương này dạy bạn làm thế nào để sử dụng các nguồn dữ liệu SQL và dữ liệu điều khiển để phát triển các ứng dụng cơ sở dữ liệu với mã VB ít hoặc không có. Sau đó, nó dạy làm thế nào để sử dụng đối tượng nguồn dữ liệu | Chapter 17 How to use object data sources 583 A typical update method Public Shared Sub UpdateCategory ByVai originalcategory As Category ByVai category As Category As Integer Dim con As New SqlConnectỉon GetConnectỉonStrỉng Dim up As String UPDATE Categories SET ShortName ShortName LongName LongName WHERE CategorylD @original_CategoryID AND ShortName originalShortName AND LongName @original_LongName Dim cmd As New SqlCommand up con @ShortName LongName @original_CategoryID @original_ShortName @original_LongName 0 End Sub How parameters are generated When the insert or delete method is called one parameter of the business class type is generated and passed to the method. The parameter that s declared in the method can have any name you choose. One parameter of the business class type is also generated and passed to the update method when this method is called if optimistic concurrency isn t used. The parameter that s declared in the method can have any name you choose. If optimistic concurrency is specified two parameters are generated and passed to the update method. One contains the original values and the other contains the new values. The name of the parameter that contains the original values must be the same as the name of the parameter that contains the new values preceded by the string that s specified by the OldValuesParameterFormatString attribute. Requirements for the business class The class must provide a parameterless constructor. The class must have public properties with names that match the names of the bound fields that are passed to the object data source from the bound control. The public properties must have both get and set procedures. Description To .