Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 22nd, 2007, 09:49 PM
Authorized User
Join Date: Aug 2007
Location: , , Singapore.
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yukijocelyn
Default Insert DropDownList(DetailsView) value toMS Access


I'm experiencing one problem here. I have a DropDownList in my Details View. However, I am unable to get its value(AAA or BBB or CCC) to be inserted into the MS Access database that I want to. The codes are as such:


<asp:AccessDataSource ID="AccessDataSource1" runat="server" ConflictDetection="CompareAllValues" DataFile="~/App_Data/DB.mdb"
DeleteCommand="DELETE FROM [table] WHERE [ID] = ?
InsertCommand="INSERT INTO [table] ([o] VALUES (?)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [ID], [o] FROM [table]"
UpdateCommand="UPDATE [table] SET [o]] = ? WHERE [ID] = ? ">

<asp:Parameter Name="o" Type="String" />

<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" CellPadding="4" DataKeyNames="ID" DataSourceID="AccessDataSource1" DefaultMode="Insert" ForeColor="#333333" GridLines="None" Height="263px" Style="z-index: 106; left: 8px; position: absolute; top: 93px" Width="694px">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
<EditRowStyle BackColor="#2461BF" />
<RowStyle BackColor="#EFF3FB" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<asp:CommandField ShowInsertButton="True" />
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="allocatedID" />

<asp:BoundField DataField="o" HeaderText="o" SortExpression="o"/>
<asp:TemplateField HeaderText="Company"><EditItemTemplate>
     <asp:DropDownList ID="DropDownList1" runat="server" DataTextField="o" DataValueField="o">
<FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />


Please advise me on how to go about solving this problem.
Thank you!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing DropDownList in DetailsView firblazer ASP.NET 3.5 Basics 2 June 21st, 2008 06:48 AM
Cannot bind from DropDownList to DetailsView kiekar ASP.NET 2.0 Basics 0 February 19th, 2008 09:26 PM
DropDownList value insert to MS DB(DetailsView) yukijocelyn ASP.NET 2.0 Basics 2 August 23rd, 2007 01:32 AM
Re-Binding A Dropdownlist In A DetailsView cyber0ne BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 26th, 2007 07:10 PM
dropdownlist value into detailsview: how? hertendreef ASP.NET 2.0 Professional 0 June 26th, 2006 01:54 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.