How to display data in dropdown from Database According betbeen Range
Hi sir. I want to display data from dropdown list According given range.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Krishna GaradRank #191 · 12.8K reputationPosted Feb 2, 2011, 9:01 PM EST
DDlEmail.DataSource =ds.Tables[0];
DDlEmail.DataValueField = "AccountName";//will contain value
DDlEmail.DataTextField = "AccountName";//will display text
DDlEmail.DataBind();
manoj kumar124 reputationPosted Feb 2, 2011, 9:06 PM EST
but this is not my requirment. I want to display data by Given Range to textbox
Ex:--1to100 values display in dropdown..
Krishna GaradRank #191 · 12.8K reputationPosted Feb 2, 2011, 9:12 PM EST
Krishna GaradRank #191 · 12.8K reputationPosted Feb 2, 2011, 9:18 PM EST
Select * From TableName Where RowNum between 50 and 100manoj kumar124 reputationPosted Feb 2, 2011, 9:32 PM EST
Krishna GaradRank #191 · 12.8K reputationPosted Feb 2, 2011, 9:35 PM EST
SqlDataAdapter da = new SqlDataAdapter("select * from Account Where Rownum Between"+TextBox1.Text+"And"+TextBox2.Text,con);
manoj kumar124 reputationPosted Feb 2, 2011, 11:47 PM EST
Incorrect syntax near 'And100'.
how it possible.
Krishna GaradRank #191 · 12.8K reputationPosted Feb 2, 2011, 11:52 PM EST
SqlDataAdapter da = new SqlDataAdapter("select * from Account Where Rownum Between "+TextBox1.Text+" And "+TextBox2.Text,con);
Suthish NairRank #92 · 22.8K reputationPosted Feb 3, 2011, 12:04 AM EST
I alread said Krishna, its a bad way of coding. Always use Parametrised Queries.
REFER
Krishna GaradRank #191 · 12.8K reputationPosted Feb 3, 2011, 12:12 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 3, 2011, 12:22 AM EST
Krishna GaradRank #191 · 12.8K reputationPosted Feb 3, 2011, 12:25 AM EST
manoj kumar124 reputationPosted Feb 3, 2011, 12:26 AM EST
I have another question. Can i bind Textbox
Krishna GaradRank #191 · 12.8K reputationPosted Feb 3, 2011, 12:30 AM EST
manoj kumar124 reputationPosted Feb 3, 2011, 1:12 AM EST
I want make a Emailer. I want to select id from database for send.
select id from database according my range .then send mail all id..how it possible.
Krishna GaradRank #191 · 12.8K reputationPosted Feb 3, 2011, 2:23 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 4, 2011, 9:44 AM EST
So other members can easily find the answers.