I am creating a project in which I need to run 2-3 SQL commands in a single SQL connection. Here is the code I have written:
SqlConnection con = new SqlConn
This is likely to be attacked via SQL injection by the way. It'd be worth while reading up on that and adjusting your queries accordingly.
Maybe look at even creating a stored proc for this and using something like sp_executesql which can provide some protection against this when dynamic sql is a requirement (ie. unknown table names etc). For more info, check out this link.