Click here to Skip to main content
14,266,139 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,
I am developed one Book Seller Application.In data Base after date expire Subscribed Customers display in Data Grid view. How to Display the Data Grid view.?
Posted
Comments
Chandan Aryan 5-Apr-12 8:01am
   
Do u want to bing grid or any further controls placed in grid?
Rate this:
Please Sign up or sign in to vote.

Solution 1

   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

   
Rate this:
Please Sign up or sign in to vote.

Solution 3

Form:
protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {   
                Bind();
        }

    }  


public void Bind()
   {

       setConnectionString();

       query = "select * from userinfo";
       //Session["GridView1"] = EmpBal.bindgridBAL(query, conString);
       DataSet ds = EmpBal.bindgridBAL(query, conString);
       GridView1.DataSource = ds;
       GridView1.DataBind();

   }

Data Layer:
public DataSet bindgridDAL(string query, string conString) 
    
    {
     try
        {
            SqlDataAdapter da = new SqlDataAdapter(query,conString);
            ds = new DataSet();
            da.Fill(ds, "EmpDetail");
            da.Dispose();
        }
        catch (Exception ex)
        {
            throw ex;
        }
     return ds;
    }

it is for 3 tier architecture.
Business layer:
Public DataSet bindgridBAL(string query, string conString)
    {
        try
        {
            return empDAL.bindgridDAL(query, conString);
        }
        catch (Exception ex)
        {
            throw ex;
        }
     }
   
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100