Lill Lansey
Lill Lansey

Reputation: 4915

Looking for a shortcut for specificying parameters in an ObectDataSource UpdateMethod

I am using an ObectDataSorce in my asp.net C# code, with SelectMethod() that calls a method that returns List< Employee>.

(I don't think it matters to the question, but I am displaying the data in the UI in an infragistics webdatagrid.)

I am working on UpdateMethod() now.

I tried using Employee employee as the input parameter to the method, as I used as the parameter in the SelectMethod(), but the compiler is looking for each property in Employee broken out as a separate parameter, i.e. String Fn, String Ln, String Address1 , etc.

Any there any shortcuts for doing this rather than creating the method with a whole long list of parameters? Or leaving out the parameters for stuff that was readonly?

Upvotes: 1

Views: 94

Answers (1)

kolbasov
kolbasov

Reputation: 1588

You should set ObjectDataSource.DataObjectTypeName to Employee.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdatasource.dataobjecttypename.aspx

Upvotes: 2

Related Questions