Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #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

Hi

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] = ? ">

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

<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" />
<Fields>
<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">
         <asp:ListItem>AAA</asp:ListItem>
         <asp:ListItem>BBB</asp:ListItem>
         <asp:ListItem>CCC</asp:ListItem>
                 </asp:DropDownList>
         </EditItemTemplate>
     </asp:TemplateField>
</Fields>
<FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:DetailsView>

--------------------------------------------------------------------------------

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.