TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vasu Gadhiya
NA
429
102.9k
Entitydatasource filter with IN clause
Mar 21 2015 9:34 AM
i am using IN with Where parameter in Entitydatasource.
if i Writing this, it complete return Men, Unisex. value.
<asp:EntityDataSource ID="EntityDataSource_Pendant" runat="server"
EnableFlattening="False"
ConnectionString="name=MyEntities"
DefaultContainerName="MyEntities"
EntitySetName="Pendants"
AutoGenerateWhereClause="False"
AutoGenerateOrderByClause="True"
Where="it.Gender IN {'Men','Unisex'}"
onselected="EntityDataSource_Pendant_Selected" >
<WhereParameters>
<asp:Parameter Name="Gender" Type="String"/>
</WhereParameters>
-----------------------------------------
but if i Write this, it cant return any data.....
<asp:EntityDataSource ID="EntityDataSource_Pendant" runat="server"
EnableFlattening="False"
ConnectionString="name=MyEntities"
DefaultContainerName="MyEntities"
EntitySetName="Pendants"
AutoGenerateWhereClause="False"
AutoGenerateOrderByClause="True"
Where="it.Gender IN {@Gender}"
onselected="EntityDataSource_Pendant_Selected" >
<WhereParameters>
<asp:Parameter Name="Gender" Type="String" DefaultValue="'Men','Unisex'"/>
</WhereParameters>
also it cant set return from CodeBehind..
--------------------------
EntityDataSource_Pendant.WhereParameters["Gender"].DefaultValue = "'Men','Unisex'"
;
-----------------------------
i also refer below link, but i cant get solution.
http://forums.asp.net/t/2018683.aspx?Entitydatasource+filter+with+IN+clause
http://forums.asp.net/t/1817009.aspx?Entitydatasource+filter+with+IN+clause
Reply
Answers (
0
)
how to get the columns from multiple tables into a single qu
MVC