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.
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.
But something like this.
(,'[email protected]', '12', 'Joe', 'Bloggs', 'Joseph Bloggs', '11JB0666')
So that would be the bit of code of the VALUES in the sql script.
Would this be possible?
I did think i could use something like this...
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();
Any help or suggestions would be great thanks.