Using C# & MYSQL
Using Combobox in my webpage, in a combobox i want to display a null values first, then it should display all values..
For Example
Combobox.item = null values
combobox.item = 1
Combobox.item = 2
....,
Code
cmd = new OdbcCommand("Select vehicleno as vehicleno from tb_car", con);
ada = new OdbcDataAdapter(cmd);
ada.Fill(data1);
cmbvnoview.DataValueField = "vehicleno";
cmbvnoview.DataSource = data1;
cmbvnoview.DataBind();
Above code is working, but is displaying all the values, first it should display a null value, then it should display all the values.
How to modify my code….
Need Code Help
Try this after you data bind
Change -1 with whatever you feel confortable with. You will have to change your sql to filter out nulls.
OR
try this
Your question does not quite make sense so this may not be the right answer.