We typically do our saves and deletes for our asp.net pages (SQL Server as back-end) in the code behind. I've seen some reference the idea of creating a stored procedure for this purpose. Is this the best approach or is what I'm doing practical enough? Any suggestions? Here's an example of the delete button function (first half is for triggers set up in SQL):protected void DeleteClick(object sender, EventArgs e){    cookie = Request.Cookies[pAuthCookie];    if (txtKey.Text == )    {        string scriptstring = alert('User Error - Must Select Fromn the LIST first.');;        ScriptManager.RegisterStartupScript(Tab1, typeof(string), alertscript, scriptstring, true);        if (TabContainer1.ActiveTabIndex == 1)            TabContainer1.ActiveTabIndex = 0;        return;    }    else    {        String fprescript = txtKey.Text;        string empno = cookie[thenum].ToString();        string sqlstring1 = UPDATE prescriptions set empfk = @empfk WHERE prescriptpk = @prescriptpk;        con.Open();        SqlCommand cmd1 = new SqlCommand(sqlstring1, con);        cmd1.Parameters.Add(@prescriptpk, SqlDbType.Int);        cmd1.Parameters.Add(@empfk, SqlDbType.Int);        cmd1.Parameters[@prescriptpk].Value = Convert.ToInt32(fprescript);        cmd1.Parameters[@empfk].Value = empno.Trim();        cmd1.ExecuteNonQuery();        con.Close();        string sqlstring = DELETE FROM prescriptions WHERE prescriptpk = @prescriptpk;        con.Open();        SqlCommand cmd = new SqlCommand(sqlstring, con);        cmd.Parameters.Add(@prescriptpk, SqlDbType.Int);        cmd.Parameters[@prescriptpk].Value = Convert.ToInt32(fprescript);        cmd.ExecuteNonQuery();        con.Close();        clearoutdata();        TabContainer1.ActiveTabIndex = 0;        GridView1.DataBind();    }}
Should I be using a stored procedure for this function in my code behind?
c#;sql;asp.net