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
User107
NA
28
17.6k
display gridview based on multi selected dropdown items
Sep 9 2016 3:50 AM
In my application i have multi selected dropdownlist and based on selection i need to display in gridview. If i select two items from multi select dropdown based on selected items i need to display records on gridview . In the below code i select two i am getting first selection records only.
i tried code:
protected void ddlcol2_SelectedIndexChanged(object sender, EventArgs e)
{
string qry = "select * from Collections where col1='" + ddlcol1.SelectedValue.ToString() + "' and col2='" + ddlcol2.SelectedValue.ToString() + "'";
SqlCommand cmd = new SqlCommand(qry,con);
DataTable dt = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(dt);
Gridview1.DataSource = dt;
Gridview1.DataBind();
}
ddlcol2 is the multi select dropdown if i select two items from ddlcol2 i want to display that two items records on gridview.
Can anyone please tell me to how to do this.
Thank you
Reply
Answers (
4
)
how to fetch the video from sql database ..
how to get breadcrumbs path in li html mvc anchor tag