void GetCommodity() { comdtobj = new Commodity_MP(ComObj); DataSet ds = comdtobj.selectAll(" order by Commodity_Name desc"); GridView1.DataSource = ds; GridView1.DataBind(); }
void GetCommodity() { comdtobj = new Commodity_MP(ComObj); DataSet ds = comdtobj.selectAll(" order by Commodity_Name desc"); ddlcomdty.DataSource = ds.Tables[0]; ddlcomdty.DataTextField = "Commodity_Name"; ddlcomdty.DataValueField = "Commodity_Id"; ddlcomdty.DataBind(); // ddlcomdty.Items.Insert(0, "--Select--"); }
void GetCommodity() { if (con.State == ConnectionState.Closed) { con.Open(); } comdtobj = new Commodity_MP(ComObj); DataSet ds = comdtobj.selectAll(" order by Commodity_Name desc"); ddlcomdty.DataSource = ds.Tables[0]; ddlcomdty.DataTextField = "Commodity_Name"; ddlcomdty.DataValueField = "Commodity_Id"; ddlcomdty.DataBind(); ddlcomdty.Items.Insert(0, "--Select--"); if (con.State == ConnectionState.Open) { con.Close(); } }