I have a sql insert in my code behind that includes a number of parameters e.g.
I want additionally to set the default value to 0 on a couple of the parameters where the controls are only visible conditionally.
In a previous version of the page this was possible because the sql was written as a datasource:
<asp:ControlParameter ControlID="DDLMatterNo" PropertyName="selectedvalue" Name="matterNumber" DefaultValue="0" />
But in the code behind the method only accepts 2 arguments so the below attempt gets a syntax error - how to overcome this?
cmd.Parameters.AddWithValue("@matterNumber", DDLMatterNo.SelectedValue, Convert.ToInt32(0));