Should I be using a stored procedure for this function in my code behind?
This is overall comments on above code

1) Encapsulate what is repeating 

In your method you are opening sql connection, adding parameter  and executing it one by one. Rather doing this please extract out it into one method. 

 private void ExecuteNonQuery(string connectionstring, string query, IEnumerable&lt;SqlParameter&gt; parameters =null)
  {
            using (var connection = new SqlConnection(connectionstring))
            {
                connection.Open();
                using (var command = new SqlCommand(query, connection))
                {
                    if (parameters != null)
                    {
                        foreach (var parameter in parameters)
                        {
                            command.Parameters.Add(parameter);
                        }
                    }
                    command.ExecuteNonQuery();
                }
            }
   }


2) Always dispose the connection 

In above code your opening connection and closing it, but this can lead into connection leak in case of errors. Please wrap your code into using statement or try clause like this 

using (var connection = new SqlConnection())
{

}


3) Distribute your responsibility into layer 

The above code is doing too much 


script registering
Sql Connection stuff
Data Populating and clearing 


Please separate out your code into at least two classes
1) Fetching data class 
2) UI binding stuff class 

4)inline SQL vs Stored Procedure 

Stored Procedure is good as your code lies at one place in db but creating Stored Procedure for one line of SQL is not a good idea. If your logic is going to be complex and big ,Use a Stored procedure other wise inline sql.

PS: I have created a  gist named SQLHelper class for you to abstract out the sql connection and command things, 

https://gist.github.com/paritoshmmmec/5c3855af7215ac87d787