Example #1
0
 void LoadAllMainCatagoryInDropDowmList()
 {
     DropDownListCatagory.DataSource     = addNewProductManagerObj.BindAllMainCatagory();
     DropDownListCatagory.DataValueField = "CatagoryID";
     DropDownListCatagory.DataTextField  = "CatagoryName";
     DropDownListCatagory.DataBind();
     DropDownListCatagory.Items.Insert(0, new ListItem("--Select--", "0"));
 }
Example #2
0
 protected void LodaCatagory()
 {
     using (SqlConnection con = new SqlConnection(cs))
     {
         SqlCommand cmd = new SqlCommand("SELECT CatagoryID, CatagoryName FROM ProductCatagory", con);
         con.Open();
         DropDownListCatagory.DataSource     = cmd.ExecuteReader();
         DropDownListCatagory.DataTextField  = "CatagoryName";
         DropDownListCatagory.DataValueField = "CatagoryID";
         DropDownListCatagory.DataBind();
         ListItem liCatagory = new ListItem("Select Product Catagory", "-1");
         DropDownListCatagory.Items.Insert(0, liCatagory);
     }
 }