Author: mcru | Posted on: 2/19/2009 3:47:24 PM | Views : 297

 So I've got 3 different ways all to do the same thing. In the below code is an example of each way. I was hoping you guys could tell me which way is the "proper" way, and which way I should use in the future.
 
 Should I do my database interaction in the method, or put it in another method and call it like I am with insertAC(); ?

protected void btnAddExport_OnClick (object sender, EventArgs e)
{
pnlUpdate.Visible = false;
GridView1.SelectedIndex = -1;

//create and open a connection object
SqlConnection Connection =
new SqlConnection(ConfigurationManager.ConnectionStrings["CCString"].ConnectionString);

Connection.Open();

insertAC();

string Go to the complete details ...