title: Better way to execute a lot of SQL commands in Visual Basic?
body: <p>I'm using MVC4 with Visual Basic to make a web system. But when I have to save my data in my tables and relationships, I need to save in a lot of tables. So, I do this:</p>
  
  <pre><code>conn.Open()
  Dim guardador_datos2 As New SqlCommand("INSERT INTO Creadores (ID_Creador,Usuario)  VALUES (" + ultimo_id_creador.ToString() + ", '" + creada_por + "')", conn)
  guardador_datos2.ExecuteNonQuery()
  conn.Close()
  
  conn.Open()
  Dim guardador_datos3 As New SqlCommand("INSERT INTO ReunionCreada_X_Usuario (ID_Reunion,ID_Creador) VALUES (" + ultimo_id.ToString() + "," + ultimo_id_creador.ToString() + ")", conn)
  guardador_datos3.ExecuteNonQuery()
  conn.Close()
  
  conn.Open()
  Dim guardador_datos4 As New SqlCommand("INSERT INTO Reuniones_X_DepartamentoEmpresa (ID_Departamento_X_Empresa,ID_Reunion) VALUES (" + departamento.ToString() + "," + ultimo_id.ToString() + ")", conn)
  guardador_datos4.ExecuteNonQuery()
  conn.Close()
  </code></pre>
  
  <p>I'm opening and closing the <code>SqlConnection</code> <code>conn</code> a lot of times (I only put three for example in here, but really there are like 9 <code>conn.Open</code> and <code>Close</code>). </p>
  
  <p><strong>Isn't there a better way to do this?</strong> Like only open <code>conn</code> 1 time and execute everything?
  Actually if I do that, it sends me an error telling me that the connection is actually open</p>