Click here to Skip to main content
15,887,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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?

 
Share this answer
 
v2
 
Share this answer
 
Form:
C#
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:
C#
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:
C#
Public DataSet bindgridBAL(string query, string conString)
    {
        try
        {
            return empDAL.bindgridDAL(query, conString);
        }
        catch (Exception ex)
        {
            throw ex;
        }
     }
 
Share this answer
 
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900