Link to home
Start Free TrialLog in
Avatar of joeylu
joeylu

asked on

objectdatasource update method at code behind

I have a objectdatasource with specified UpdateParameters at page,
and I want to do the objectdatasource.update() at code behind
How do I full filled all the required updateparameters at code behind before I call the update()?

I've tried ODS1.UpdateParameters.Insert("cID", string123)

it didn't work, popup an error msg says "cannot find generic method "update" that has parameters (cID)

any help?
<asp:ObjectDataSource ID="ODS1" runat="server" 
              OldValuesParameterFormatString="original_{0}" UpdateMethod="Update">
              <UpdateParameters>
                  <asp:Parameter Name="cID" Type="Int32" />
                  <asp:Parameter Name="cName" Type="String" />
              </UpdateParameters>
            </asp:ObjectDataSource>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of drypz
drypz
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of joeylu
joeylu

ASKER

yes, i was forced to use defaultvalues, but it doesn't quite the same anyway, guess there should be a better way