Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking 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 Basics 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 28th, 2007, 10:15 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 No DetailsView display on adding FilterExpression

Hi

I have a problem here. I have a DetailsView control, DropDownList control, and 2 AccessDataSource controls named AcDsrcDDL & AcDsrcDV for accessing by DropDownList & DetailsView respectively.
I want to make it work like, I choose the number in the DropDownList(tied to AcDsrcDDL), AcDsrcDV will then get the value(eg: 1190), then filter the database to get the data for allocatedID = 1190 only. However, after I added the codes(in bold), my DetailsView never got displayed at all already.
How can I solve this problem? Thank you!

<asp:AccessDataSource ID="AcDsrcDDL" runat="server" DataFile="~/App_Data/DB.mdb"
 SelectCommand="SELECT [allocatedID] FROM [table] ORDER BY [allocatedID]">
</asp:AccessDataSource>

<asp:AccessDataSource ID="AcDsrcDV" runat="server" DataFile="~/App_Data/DB.mdb"
 SelectCommand="SELECT * FROM [table] ORDER BY [allocatedID]"
 FilterExpression="allocatedID='{0}'">
 <FilterParameters>
   <asp:ControlParameter Name="allocatedID" ControlID="DropDownList1"
    PropertyName="SelectedValue" />
</FilterParameters>

</asp:AccessDataSource>

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
 BackColor="LightBlue" Font-Names="Arial Narrow" Height="238px" Style="z-index: 101;
 left: 537px; position: absolute; top: 53px" Width="243px" DataSourceID="AcDsrcDV">
</asp:DetailsView>

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
 DataSourceID="AcDsrcDDL" DataTextField="allocatedID" DataValueField="allocatedID"
 Style="z-index: 104; left: 344px; position: absolute; top: 5px">
</asp:DropDownList>


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates in FilterExpression of Sqldsource mallikalapati ASP.NET 2.0 Professional 0 March 31st, 2008 11:11 PM
FilterExpression multiple parameters/placeholders NigelBronson ASP.NET 2.0 Basics 0 September 27th, 2006 04:57 PM
DetailsView faithfulman ASP.NET 2.0 Basics 1 September 22nd, 2006 11:16 PM
detailsview pau5160 ASP.NET 2.0 Basics 0 August 21st, 2006 10:47 PM





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