dropdownlist value isn't being saved to database from FORMVIEW

J

Jon Paal

--dropdownlist value isn't being saved to database from FORMVIEW
--field PriorityID is datatype "number" (integer)

what's missing ????

'=========code=============

<asp:Content ID="Content1" ContentPlaceHolderID="PageContentPlaceHolder" runat="Server">

<asp:AccessDataSource id="DataSource1" Runat="Server"
DataFile="~/APP_Data/db1.mdb"
InsertCommand="INSERT INTO MyList (PriorityID) VALUES (@PriorityID);">
<InsertParameters>
<asp:parameter Name="PriorityID" Type="int32" />
</InsertParameters>
</asp:AccessDataSource>


<asp:FormView id="FormView1" Runat="Server"
DataKeyNames="id"
DataSourceID="DataSource1"
DefaultMode="Insert">

<InsertItemTemplate>
<table id="AddTable" >
<tr>
<td><asp:DropDownList id="PriorityID" Runat="Server">
<asp:ListItem Text="-- Select Category --" Value="-1"> </asp:ListItem>
<asp:ListItem Text="-2" Value="-2"> </asp:ListItem>
<asp:ListItem Text="-3" Value="-3"> </asp:ListItem>
</asp:DropDownList>
</td>
</tr> <tr>
<td class="buttons">
<asp:Button id="InsertButton" CommandName="Insert" Text="Insert"
Font-Size="9pt" Width="50" Runat="Server"/>
</td>
</tr>
</table>
</InsertItemTemplate>
</asp:FormView>

</asp:content>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top