string strCategory1 = “select categoryname,categoryid from tbl_test where status=’Active’”;
SqlCommand cmdCategory1 = new SqlCommand(strCategory1, conn);
cmdCategory1.CommandType = CommandType.Text;
SqlDataAdapter daCategory1 = new SqlDataAdapter(cmdCategory1);
DataSet dsCategory1 = new DataSet();
daCategory1.Fill(dsCategory1, “tbl_maincategory”);
drpmaincategory.DataSource = dsCategory1.Tables["tbl_test"];
drpmaincategory.DataTextField = “categoryname”;
drpmaincategory.DataValueField = “categoryid”;
drpmaincategory.DataBind();
SqlCommand mySqlSelect = new SqlCommand(“Select * from tbl_list where id= ‘” + Request.Params.Get(“id”) + “‘”, conn);
mySqlSelect.CommandType = CommandType.Text;
SqlDataAdapter mySqlAdapter = new SqlDataAdapter(mySqlSelect);
DataSet dt1 = new DataSet();
mySqlAdapter.Fill(dt1);
DataTable dtr1 = dt1.Tables[0];
string m = dt1.Tables[0].Rows[0]["categoryid"].ToString();
drpmaincategory.SelectedValue = m;
drpmaincategory_SelectedIndexChanged(sender, e);
drpsubcategory.SelectedValue = dt1.Tables[0].Rows[0]["subcategoryid"].ToString();
string strCategory3 = “select * from tbl_category where status=’Active’
and id=’” + drpmaincategory.SelectedValue.ToString() + “‘”;
SqlCommand cmdCategory3 = new SqlCommand(strCategory3, conn);
cmdCategory3.CommandType = CommandType.Text;
SqlDataAdapter daCategory3 = new SqlDataAdapter(cmdCategory3);
DataSet dsCategory3 = new DataSet();
daCategory3.Fill(dsCategory3, “tbl_subcategory”);
drpsubcategory.DataSource = dsCategory1.Tables["tbl_category"];
drpsubcategory.DataTextField = “subcategoryname”;
drpsubcategory.DataValueField = “subcategoryid”;
-
The following article discusses the WPF command binding feature with relation to Mouse clicks. One of WPF powerful features is the bindin...
-
SQL Server has never been short of ways to read from and write to files and it is always better to use the standard techniques provided b...
-
In this article we will look at the basics of Angular.Js. This is the first part of an article series. The main objective of this series i...