I was use SQL Connection to Access Data Base in Past and When Select Data in DataSet make it static & than it can avaliable on class level.
I click on Edit Button its avalibale because its Static.
Than now i think try it with LINQ it's provide easy Access to Data Base; in Insert/Update/Delete than SQL Connection it look's me great when i use it.
But i don't know how to make var Query Static for its class level avaliability
i can define it by my code
public static DataSet DsCustomers;
protected void Page_Load(object sender, EventArgs e)
Sqlconnection con = new Sqlconnection(ConnectionString.....);
string SelectQuery = "Select * From Customers";
SqlCommand cmd = new SqlCommand(SelectQuery,con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DsCustomers = new DataSet();
GridCustomers.DataSources = dsCustomers;
In this Example DataSet is static & its avaliable on class level
View Complete Post