Mark
Mark

Reputation: 53

using different number of parameters for sqldatasource insert and update

I have a sqldatasource with insert and update commands. I list 10 user fields in the detailsview that uses the sqldatasource. However, when i insert, I insert all 10 fields, but when I update, I only want to update 8 fields. This is causing a problem because I believe all 10 fields displayed are being passed as parameters even though my insertparameters and updateparameters sections are declared with the appropriate number of parameters. Is there a way I can easily insert all 10 parameters but only send 8 to the update stored procedure?

Upvotes: 0

Views: 386

Answers (1)

Mike Brind
Mike Brind

Reputation: 30035

Change the UpdateCommand and its parameters from the generated ones to what you want.

Upvotes: 1

Related Questions