protected void Load_Product(string pguid) { SqlProduct.SelectCommand = "SELECT * FROM [dbo].[nthing_Store_Product] where ProductGuid = '" + pguid + "'"; SqlProduct.DataBind(); ProductView.DataSource = SqlProduct; ProductView.DataBind(); }
protected void Load_Product(string pguid) { SqlProduct.SelectCommand = "SELECT * FROM [dbo].[nthing_Store_Product] where ProductGuid = '" + pguid + "'"; SqlProduct.DataBind(); ProductView.DataSource = SqlProduct; ProductView.DataBind(); if (!Page.IsPostBack) { SqlConnection cnn = new SqlConnection(strConn); SqlCommand cmd = new SqlCommand("SELECT FORMAT ([AuctEndTime], 'MM dd yyyy HH:mm:ss') as AuctEnd FROM [dbo].[nthing_Store_Product] where ProductGuid = '" + pguid + "'", cnn); cnn.Open(); string retval = cmd.ExecuteScalar().ToString(); cnn.Close(); HidendDateLab.Value = retval; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["Uid"] == null) { Response.Redirect("1_Login.aspx"); return; } welcome.InnerText = "Welcome User: "******"Uid"]; db_init(); ProductView.DataSource = ds.Tables["products"]; ProductView.DataBind(); ProductList.Items.Clear(); ProductList.SelectionMode = ListSelectionMode.Multiple; foreach (DataRow row in ds.Tables["products"].Rows) { ProductList.Items.Add(row["pname"].ToString()); } } }