protected void Page_Load(object sender, EventArgs e) { lblproname.Text = Request.QueryString["ID"]; /* if (!IsPostBack) * { * string query = "select * from Supplier "; * DataSet ds = obj.fillgrid(query); * DataTable dt = ds.Tables[0]; * * foreach (DataRow dr in dt.Rows) * { * lblcustomerID.Text = dr["CustomerID"].ToString(); * * lblfirstname.Text = dr["FirstName"].ToString(); * lbllastname.Text = dr["LastName"].ToString(); * lblcompany.Text = dr["Company"].ToString(); * * * * } */ if (!IsPostBack) { string querydr = "select SupplierName from Supplier"; SqlDataReader dr1 = obj.fillcomb(querydr); DropDownList1.DataSource = dr1; DropDownList1.DataValueField = "SupplierName"; DropDownList1.DataBind(); } }
// public static string connectionString = "Data Source=FAROOQPC\\SQLEXPRESS; Initial Catalog=shop; Integrated Security=True"; //string query = "select Sum(totalAmount) from Orders where OrderDate between '" + startDate + "' and '" + endDate + "'"; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string querydr = "select OrderDate from Orders"; SqlDataReader dr = obj.fillcomb(querydr); DropDownList1.DataSource = dr; DropDownList1.DataValueField = "OrderDate"; DropDownList1.DataBind(); } if (!IsPostBack) { string querydr = "select OrderDate from Orders"; SqlDataReader dr = obj.fillcomb(querydr); DropDownList2.DataSource = dr; DropDownList2.DataValueField = "OrderDate"; DropDownList2.DataBind(); } }
public void links() { string querydr = "select * from Products"; SqlDataReader dr = obj.fillcomb(querydr); while (dr.Read()) { if (proid == String.Empty) { proid = dr["ProductID"].ToString(); } else { proid += "," + dr["ProductID"].ToString(); } } //Response.Redirect("ProductCatalog.aspx?ID=" + proid + "&LoadGridView=true"); }
public void orderbind() { string querypro = "select productname from products"; SqlDataReader dpros = obj.fillcomb(querypro); //DropDownList1.DataSource = dr; dpproductname.DataSource = dpros; //DropDownList1.DataValueField = "CategoryName"; dpproductname.DataValueField = "ProductName"; dpproductname.DataBind(); //DropDownList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { //dbcon obj = new dbcon(); if (!IsPostBack) { string querydr = "select * from Categories"; SqlDataReader dr = obj.fillcomb(querydr); DropDownList1.DataSource = dr; DropDownList1.DataValueField = "CategoryName"; DropDownList1.DataBind(); // Response.Redirect("procat.aspx"); /* if (!IsPostBack) * { * bind(); * * }*/ } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { bind(); } if (!IsPostBack) { userinrole(); } if (!IsPostBack) { string querydr = "select * from groups"; SqlDataReader dr = obj.fillcomb(querydr); DropDownList1.DataSource = dr; DropDownList1.DataValueField = "RoleName"; DropDownList1.DataBind(); } }