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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top