puskar maji

puskar maji

  • NA
  • 20
  • 0

dropdown

Feb 2 2009 1:25 AM
SqlDataAdapter da1 = new SqlDataAdapter("select * from menu_cat where res_id=" + Context.Request.QueryString["id"], con);
            da1.Fill(ds1, "menu_cat");
            cat_dd.DataSource = ds1;
            cat_dd.DataTextField = "cat_name";
            cat_dd.DataValueField = "cat_id";

             cat_dd.DataBind();
now i want to know if above sql does not fetch any record then i want to populate cat_dd dropdown box as "select" value only. but bellow code does not working.
            if (cat_dd.Selectedvalue == null)
            {
               // cat_dd.DataTextField = "Select....";
            }
          

Answers (2)