I would like to execute 2 queries in C # when the button is clicked, but I can only execute one.
public static void excluireventos()
{
string connectionString = Conn.tank();
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
string query = string.Format("TRUNCATE TABLE Active" + "TRUNCATE TABLE Active_Number");
using (SqlCommand cmd = new SqlCommand(query,connection))
{
cmd.ExecuteNonQuery();
Globals.UpdateLogs("Todos os eventos foram excluidos com exito!");
}
}
}
The two queries are TRUNCATE
, if I put one will usually more if I put two of the error in the program and date.
How can I perform 2 queries or more?