Hi,
The question aint very clear.
You can store your variables in a table and on Page_Load() event of the asp.net page , you cud assign it to the gridview.
Data access layer, you cud do something like:
public DataTable Grid()
{
SqlDataAdapter da1 = new SqlDataAdapter("select * from Sample.dbo.tblName", xconn);
DataTable ds = new DataTable();
da1.Fill(ds);
return ds;
}
And in the aspx.cs page, you cud do somethinmg like:
protected void Page_Load(object sender, EventArgs e)
{
DAL obj2 = new DAL();
DataTable dtnew2 = obj2.Grid();
GridView1.DataSource = dtnew2;
GridView1.DataBind();
}
Now you will have to think whether how will you store your variables, as in a table or do you wana take the values of the variables via a form from the user, in the latter case, you can call a stored procedure and stuffs. There are numerous methods, implementation depends upon scenarios and needs.
Hope it helps.
Happy coding..
regrds
anurag