Posted on: 3/16/2015 8:12:40 PM | Views : 576

i am trying to add a static value to database bind dropdown. i want static value appear first.
__________________________________________________________________________________
*.aspx
<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="true"> <asp:ListItem Text="Select a Value" Value="0"></asp:ListItem> </asp:DropDownList>
__________________________________________________________________________________
*.aspx.cs
DataTable dt = new DataTable(); using (SqlConnection cnn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["convalue"].ConnectionString)) { cnn.Open(); string query = ""; query = "select date+' , '+name q_val from emp_name order by date "; SqlCommand cmd = new SqlCommand(query, cnn);
SqlDataAdapter da = new ...

Go to the complete details ...