Ran into something new to me with ASP.net two form fields sharing the same column.
From my SqlDatasource
InsertCommand="INSERT INTO [tblRequest] ([reqMake], [reqModel], [reqCal], [reqEmail], [reqPrice], [reqType], [reqNotes], [reqAnswered]) VALUES (@reqMake, @reqModel, @reqCal, @reqEmail, @reqPrice, @reqType, @reqNotes, @reqAnswered)"
Parameters.
<InsertParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="reqMake"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList3" Name="reqModel"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="reqCal"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="txtEmail" Name="reqEmail" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="txtPrice" Name="reqPrice" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="DropDownList4" DefaultValue="" Name="reqType"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="txtRequestFireArmNotes" Name="reqNotes"
PropertyName="Text" Type="String" />
<asp:Parameter DefaultValue="False" Name="reqAnswered" Type="Boolean" />
</InsertParameters>
It is corrected in the SQLDataSource Inserting event as such.
'Add second field here.
'Event start
e.Command.Parameters("reqMake").Value = txtExample1.Text + txtExample2.Text
'Event end
No comments:
Post a Comment