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
muthukumar
NA
0
101.3k
how to write query based on dropdownlist price range
Feb 13 2014 1:40 AM
in my shopping website i wabt to show the data from database based on dropdownlist price range selection
eg: 0-10 means bind data based on price 0to 10 like that
i already writen code is below .please give correctly
protected void Button1_Click(object sender, EventArgs e)
{
string query = "SELECT * FROM fruitlist where fruitprice=@price or @price=''";
SqlCommand cmd = new SqlCommand(query);
cmd.Parameters.AddWithValue("@Country", DropDownList1.SelectedItem.Value);
using (SqlConnection con = new SqlConnection(s))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataSet ds = new DataSet())
{
sda.Fill(ds);
DataList1.DataSource = ds;
DataList1.DataBind();
}
}
}
}
thank you
Reply
Answers (
4
)
Round of Amount
search between two date in c#