Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lblCid.Text = "1000";

        objSqlcon = new SqlConnection("Data Source=LG-PC\\SQLEXPRESS;Initial Catalog=pnl;Integrated Security=True");
        string query = "select * from Party where Ptype='customer'and CompanyId=" + lblCid.Text + "";

        objSqlDa = new SqlDataAdapter(query, objSqlcon);
        objDT    = new DataTable();
        objSqlDa.Fill(objDT);
        GVSupplier.DataSource = objDT;
        GVSupplier.DataBind();
    }
Beispiel #2
0
    private void gridbind()
    {
        String cid = Session["Cid"].ToString();

        objSqlcon = new SqlConnection("Data Source=LG-PC\\SQLEXPRESS;Initial Catalog=pnl;Integrated Security=True");
        string query = "select * from Stock where CompanyId=" + cid + "";

        objSqlDa = new SqlDataAdapter(query, objSqlcon);
        objDT    = new DataTable();
        objSqlDa.Fill(objDT);
        GVSupplier.DataSource = objDT;
        GVSupplier.DataBind();
    }
Beispiel #3
0
        public void FillGrid()
        {
            try
            {
                dt_ = new DataTable();
                dt_ = DBConnection.GetQueryData(" select * from supplier where CompanyId = '" + Session["CompanyID"] + "' and BranchId= '" + Session["BranchID"] + "' order by supplierId desc");

                GVSupplier.DataSource = dt_;
                GVSupplier.DataBind();
                ViewState["Supplier"] = dt_;
            }
            catch (Exception ex)
            {
                //throw;
                ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "Alert();", true);
                lblalert.Text = ex.Message;
            }
        }
Beispiel #4
0
        protected void TBSearch_TextChanged(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(2000);
            try
            {
                FillGrid();
                DataTable _dt = (DataTable)ViewState["Supplier"];
                DataView  dv  = new DataView(_dt, "suppliername LIKE '%" + TBSearch.Text.Trim().ToUpper() + "%'", "[suppliername] ASC", DataViewRowState.CurrentRows);
                DataTable dt_ = new DataTable();
                dt_ = dv.ToTable();

                GVSupplier.DataSource = dt_;
                GVSupplier.DataBind();
                TBSearch.Text = "";
            }
            catch (Exception ex)
            {
                //   throw;
                ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "Alert();", true);
                lblalert.Text = ex.Message;
            }
        }