Hi,
here it is small method for binding employee data. i want to access this method into 5 webpages. instead of keeping every page load method i want to access only one method to all webpages how ? ?
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("Bindemployee", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();
}


Midhun TpRank #388 · 6.5K reputationPosted Oct 24, 2016, 3:42 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Oct 24, 2016, 3:22 AM EDT
Now in your grid binding function will be like below -
Gururaj JewargiRank #2,922 · 492 reputationPosted Oct 24, 2016, 3:27 AM EDT