title: ASP.net / c# SQL code submit via textbox
body: <p>I'm relativity new to asp.net / c#. I've written a couple of apps, so i can interpret the language but I'm not fluent. </p>
  
  <p>Basically each year we have students arrive into the college and i want to be able to have a textbox where i can drop the SQL code into and it automatically updates the database. Ofcourse this page will be secured.</p>
  
  <p>But something like this.</p>
  
  <pre><code>(,'11JB0666@gmail.org', '12', 'Joe', 'Bloggs', 'Joseph Bloggs', '11JB0666') 
  </code></pre>
  
  <p>So that would be the bit of code of the VALUES in the sql script. </p>
  
  <p>Would this be possible?</p>
  
  <p>I did think i could use something like this...</p>
  
  <pre><code>SqlConnection conn = new
   SqlConnection(ConfigurationManager.ConnectionStrings["ExtensionActivitesConnectionString"].ConnectionString);
      SqlCommand cmd = new SqlCommand(" Insert into dbo.Names (Email,Year,FirstName,LastName,Name,Username) VALUES (@SQL)", conn);
      cmd.Parameters.AddWithValue("@SQL", SqlTextBox.Text);
  
      conn.Open();
      cmd.ExecuteNonQuery();
      conn.Close();
  </code></pre>
  
  <p>Any help or suggestions would be great thanks.</p>