public void bind() { string query = "select * from OrderDetails inner join Products on OrderDetails.ProductID=Products.ProductID where OrderID='" + Session["OrderID"] + "'"; DataSet ds = obj.fillgrid(query); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
public void bind() { string query = "select Products.ProductID,Products.ProductName,Products.UnitCost,ShoppingCart.Quantity from Products RIGHT JOIN ShoppingCart on Products.ProductID=ShoppingCart.ProductID where CustomerID='" + User.Identity.Name + "'"; DataSet ds = obj.fillgrid(query); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
public void bind() { //string query = "select * from ESK_Products"; string query = "SELECT * FROM Products LEFT JOIN Categories ON Categories.CategoryID=Products.CategoryID Where Categories.CategoryName='" + DropDownList1.Text + "'"; DataSet ds = obj.fillgrid(query); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
public void bind() { string query = "select OrderID,CustomerID,OrderDate,totalAmount,Status From Orders where CustomerID='" + User.Identity.Name + "'"; DataSet ds = obj.fillgrid(query); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
public void bind() { //string query = "select * from ESK_Products"; string query = "SELECT * FROM Orders Where OrderDate between '" + DropDownList1.Text + "' and '" + DropDownList2.Text + "'";; DataSet ds = obj.fillgrid(query); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
private void Search() { //conn.Open(); string query = "Select * from Products where ProductName Like '" + Request.QueryString["Name"] + "%'"; //DataSet ds = new DataSet(); DataSet ds = obj.fillgrid(query); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind();; //conn.Close(); }
private void LoadGridView() { // string query = "Select * from Products where CategoryID='" + Request.QueryString["ID"] + "' Or ProductID ='" + Request.QueryString["ID"] + "'or '"+int.TryParse(Request.QueryString["PriceID"]<5000)+"'";// or ProductName='"+Request.QueryString["Name"]+"'"; if (Request.QueryString["ID"] != null && Request.QueryString["ID"].ToString() != "") { string query = "Select * from Products where ProductID in (" + Request.QueryString["ID"].ToString().Substring(1) + ") AND UnitCost < 5000"; DataSet dss = obj.fillgrid(query); GridView1.DataSource = dss.Tables[0]; GridView1.DataBind(); } //} //conn.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string query = "select customerID,FirstName,LastName,Address,totalAmount,OrderID from Orders where OrderID='" + Request.QueryString["ID"] + "'"; 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(); double dues = System.Convert.ToDouble(dr["totalamount"]); //lbladdress.Text = dr["Address"].ToString(); lblDues.Text = "Total Rs:" + dues.ToString();// dr["totalAmount"].ToString(); } } bind(); }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { string query = "select * from Supplier where SupplierName='" + DropDownList1.Text + "' "; DataSet ds = obj.fillgrid(query); DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { //lblcustomerID.Text = dr["SupplierName"].ToString(); lblcell.Text = dr["SupplierCell"].ToString(); lbladdress.Text = dr["SupplierAddress"].ToString(); //lblcompany.Text = dr["Company"].ToString(); } // Response.Redirect("stockordergrid.aspx"); }
protected void Page_Load(object sender, EventArgs e) { lblstockid.Text = Request.QueryString["ID"]; if (!IsPostBack) { //string query = "select SupplierName,SupplierCell,SupplierAddress,SupplierQuantity,OrderDate from Stock where ProductName='" + Request.QueryString["ID"] + "'"; string query = "select * from Stock where StockId='" + Request.QueryString["ID"] + "'"; DataSet ds = obj.fillgrid(query); DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { lblproname.Text = dr["ProductName"].ToString(); lblsuppliername.Text = dr["SupplierName"].ToString(); lblsuppliercell.Text = dr["SupplierCell"].ToString(); lblsupplieradress.Text = dr["SupplierAddress"].ToString(); lblorderedquantity.Text = dr["OrderedQuantity"].ToString(); lblorderingdate.Text = dr["OrderDate"].ToString(); } } }