>Greetings Kevin,
>
>Thanks, this is very helpful. Does the ODS cache the object it's based on (i.e an EntityList)? In other words, can I get access to the original entity item throught the ODS or do I need Cache, Session, or requery to get the original entity the GridView Row was based on?
E.R.
Realistically - why would you use an object data source if you are already using business objects proper? With the databinding in MM and the update mechanisms you'll be much better off implementing your own databinding than working with the funky ODS model.
+++ Rick ---
>
>Regards,
>
>E.R.
>
>>E.R.,
>>
>>>Right now the GridView is trying to hit an update method with parameters it is generating based on the columns in the GridView. What I was trying to find out from you was if there was a default update method one could specify for updating or if I will have to create a method for each Biz obj that maps to columns use in any GridView that use that biz obj. If that's the case fine, but with no documentation on using the ODS I didn't want to create all these methods and then find out later there was an easier way.
>>
>>There is no built-in method in MM .NET that accepts discrete parameters for updating, so if you want to use that appraoch you need to create custom methods on each object. That said, it's cumbersome to create and maintain a method that accepts a parameter for each grid column. Alternately, you can create a business object method that accepts an entity object of a specfic type. Here is an excerpt from an MSDN help topic (
http://msdn2.microsoft.com/en-us/library/57hkzhy5.aspx):
>>
>>Most business object method signatures take parameters of type String and Int32. However, you might be working with a business object method that takes one or more parameters typed as a complex or user-defined type. To work with complex or user-defined parameter types, you can use the ObjectDataSource control's DataObjectTypeName property.
>>
>>In your business object, creating methods with long parameter lists that map control values one-to-one to data store values can result in code that is not easily reusable. A better practice is to encapsulate your data in a custom class and then pass an instance of the class as a parameter. That way, the data that makes up an instance of the class, such as an employee record, can change without requiring any changes to the public interfaces exposed by the data source object. The following code example shows a class named NorthwindExployee that defines the employee data and that can be passed as a parameter to a business object.
>>
>>C#
>>
public class NorthwindEmployee {
>> public NorthwindEmployee() { }
>> private int _empId;
>> private string _firstName;
>> public int EmpId {
>> get { return _empId; }
>> set { _empId = value; }
>> }
>> public string FirstName {
>> get { return _firstName; }
>> set { _firstName = value; }
>> }
>> // Additional code for the class.
>>}
>>
>>Visual Basic
>>
Public Class NorthwindEmployee
>> Public Sub New()
>> End Sub
>>
>> Private _empId As String
>> Public Property EmpId() As Integer
>> Get
>> Return _empId
>> End Get
>> Set
>> _empId = value
>> End Set
>> End Property
>>
>> Private _firstName As String
>> Public Property FirstName() As String
>> Get
>> Return _firstName
>> End Get
>> Set
>> _firstName = value
>> End Set
>> End Property
>>
>> ' Additional code for the class.
>>End Class
>>
>>To accept an instance of the preceding class as a parameter, the business object's UpdateEmployeeInfo method might be defined using the following signature:
>>
>>C#
>>
public void UpdateEmployeeInfo(NorthwindEmployee emp) {
>>}
>>
>>
Visual Basic Copy Code
>>Public Sub UpdateEmployeeInfo(emp As NorthwindEmployee)
>>End Sub
>>
>>Although you cannot set the Type of a parameter to the name of a custom class, you can set the ObjectDataSource control's DataObjectTypeName property to the name of a custom user-defined type, such as the NorthwindEmployee class, and then pass an instance of the type to a business object data method. To pass user-defined objects to a data source object, the following conditions must be met:
>>
>>