title: Insert command not working on connection between C# and SQL Server
body: <p>I have this table in SQL Server: </p>
  
  <pre><code>CREATE TABLE Ciudadano (  
  ci int not null,  
  Nombre varchar(50),  
  Apellido varchar(50),  
  Correo varchar(50),  
  Usuario varchar(50), 
   Contrasena varchar(50),  
  Localidad_cod int,  
  Primary key (ci)  
  )
  </code></pre>
  
  <p>I'm trying to add data to the table <code>Ciudadano</code> from Visual Studio c#, using a stored procedure called <code>sp_ConsultarCuenta</code>:</p>
  
  <pre><code>CREATE PROCEDURE sp_ConsultarCuenta
     @ci int, @nom varchar(50), @ape varchar(50), @user varchar(50), 
     @pass varchar(50), @correo varchar(50), @loc varchar(50)
  AS
     IF NOT EXISTS(SELECT ci,Usuario FROM Ciudadano 
                   WHERE ci = @ci OR Usuario = @user)
        DECLARE @var varchar(50)
        SET @var = (SELECT cod From Localidad Where Nombre = @loc)
  
        INSERT INTO Ciudadano (ci, Nombre, Apellido, Correo, Usuario, Contrasena, Localidad_cod)
        VALUES (@ci, @nom, @ape, @user, @pass, @correo, @var)
  </code></pre>
  
  <p>And on my c# code I have this:</p>
  
  <pre><code>public void AgregarCiudadano()
  {
     string con = @"Data Source=(local);Initial Catalog=SistemaDeQuejas;Trusted_Connection=True";
     SqlConnection conexion = new SqlConnection(con);
  
     conexion.Open();
     SqlDataAdapter Comando = new SqlDataAdapter();
  
     Comando.InsertCommand = conexion.CreateCommand();
     Comando.InsertCommand.CommandText = "sp_ConsultarCuenta";
     Comando.InsertCommand.CommandType = CommandType.StoredProcedure;
     Comando.InsertCommand.Connection = conexion;
  
     Comando.InsertCommand.Parameters.Add("@ci", SqlDbType.Int).Value = System.Convert.ToInt32(ci);
     Comando.InsertCommand.Parameters.Add("@nom", SqlDbType.VarChar, 50).Value = Nombre;
     Comando.InsertCommand.Parameters.Add("@ape", SqlDbType.VarChar, 50).Value = Apellido;
     Comando.InsertCommand.Parameters.Add("@user", SqlDbType.VarChar, 50).Value = Usuario;
     Comando.InsertCommand.Parameters.Add("@pass", SqlDbType.VarChar, 50).Value = Contrasena;
     Comando.InsertCommand.Parameters.Add("@correo", SqlDbType.VarChar, 50).Value = Correo;
     Comando.InsertCommand.Parameters.Add("@loc", SqlDbType.VarChar, 50).Value = Localidad;
  
     conexion.Close();  
  }
  </code></pre>
  
  <p>What I'm doing is a Web form, and that method is called by a button on the form. But when I run it and press the button it doesn't throw any error but the data I'm trying to insert into the database table is not inserting at all. Is there something wrong on my code?</p>