Beispiel #1
0
    private void Search()
    {
        SqlString ProductName = SqlString.Null;

       
        if (txtSearchProductName.Text.Trim() != "")
            ProductName = Convert.ToString(txtSearchProductName.Text.Trim());

        ProductBAL balProduct = new ProductBAL ();
        DataTable dtProduct = balProduct.Search(ProductName);
        if (dtProduct != null && dtProduct.Rows.Count > 0)
        {
            gvProduct.DataSource = dtProduct;
            gvProduct.DataBind();
        }
        else
        {
            gvProduct.DataSource = null;
            gvProduct.DataBind();
        }
    }