Methoun Ahmed

Methoun Ahmed

  • NA
  • 145
  • 102.3k

How to show demo title in Dropdownlist

Aug 10 2018 12:25 PM
I want to show demo title in dropdownlist like 'Select Item' from binding data value in dropdownlist.Database value show perfectly but demo text not show.Bellow my C# code
 
void GetStatus()
{
if (!IsPostBack)
{
SqlDataAdapter sda = new SqlDataAdapter("SELECT Title FROM tblCloseStatus", con);
DataTable dt = new DataTable();
sda.Fill(dt);
DropDownList1.Items.Clear();
foreach (DataRow dr in dt.Rows)
{
DropDownList1.Items.Add(dr["Title"].ToString());
}
}
}
 Here is my Asp.net Code
 
 

Answers (4)