I fill this dropdown list in this way
Now I need to add at index 0 something like "Select a table..."
How do I do that?
I have tried something like this but I need to add it at index 0.
public void FillDropDownList(string connString)
{
String Query = "SELECT * FROM information_schema.tables where Table_Name like 'Table%'";
using (var cn = new SqlConnection(connString))
{
cn.Open();
DataTable dt = new DataTable();
try
{
SqlCommand cmd = new SqlCommand(Query, cn);
SqlDataReader myReader = cmd.ExecuteReader();
dt.Load(myReader);
}
catch (SqlException e)
{
//TODO
}
radDropDownList1.DataSource = dt;
radDropDownList1.ValueMember = "TABLE_NAME";
radDropDownList1.DisplayMember = "TABLE_NAME";
}
}
Now I need to add at index 0 something like "Select a table..."
How do I do that?
I have tried something like this but I need to add it at index 0.
radDropDownList1.Items.Add("Select a table...");
radDropDownList1.SelectedIndex = 0;