I am trying to create a method that executes a stored procedure that allows me to insert records in a table. However, I get an error preventing the method from running.
This is the code:
public bool Insertar(string nombre)
{
try
{
NpgsqlCommand comando = con.CreateCommand();
comando.CommandText = "EXECUTE Insertar @telefono";
comando.Parameters.Add("@telefono", parameterType: NpgsqlDbType.Varchar, size: 10, sourceColumn: "5").Value = nombre;
con.Open();
comando.ExecuteNonQuery();
con.Close();
MessageBox.Show("se guardo");
return true;
}
catch (Exception er)
{
MessageBox.Show(er.Message,"Advertencia");
return false;
}
}
And the error I get:
42601: Syntax error near