Bound Child Properties of Instance Class causing error with UpdateParameters on a ObjectDataSource [closed]?

Up vote 0 down vote favorite share g+ share fb share tw.

I have a class that has an instance property on it like below Public Class Security Public Property UserData As User End Class When I bind a GridView using an ObjectDataSource, the following syntax is used to bind a dropdown within the Gridview and works for everything but when ready to Update the record: '> See the problem seems to arise because the ComboBox has its own ObjectDataSource named odsEmployeeNames with a Key = "ID". However the GridView has its own ObjectDataSource and the ComboBox value selected is bound by '' The resulting error I get is as follows: ObjectDataSource 'odsAdminSecurity' could not find a non-generic method 'Save' that has parameters: NameID, IsAdminUser, UserData.ID, ID. The signature on the Save() method is as follows: Public Sub Save(ID As Integer, ByVal NameID As Integer, ByVal IsAdminUser As Boolean) It is trying to add in that bound value of UserData.ID, but that paramter is the "NameID" parameter and the UserData.ID it is asking for should be that value.

The way I have gotten by this in the past is to have the key name for both ObjectDataSources (ComboBox and Gridview) have the same name (i.e. Both are name 'NameID'). Any ideas on how to correct this?

Thanks! Asp.net objectdatasource link|improve this question asked Dec 20 '11 at 15:13atconway1,0581520 95% accept rate.

You're save signature has three parameters while the error is stating you have four parameters being passed to your method. Can you post the calling code so we can take a closer look? Specifically, where are you calling the Save() method?

I don't call the Save() method explicitly - the ODS does that for me and is wired up to it in the controls configuration. – atconway Jan 12 at 20:27.

Well I never totally figured this out. The fix was to modify the class design a bit to not use the child properties for binding to the combo box that contained its own ODS. By having the bound value for the employee combo match the parameter name on the Save() method, everything worked fine.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions