title: How to solve a C# & SQL Server connection problem ? Data is not begin saved
body: <p>I'm having trouble with a SQL Server connection in C#.</p>
  
  <p>My program is simple, input a name and a description, then save it with Active Record in a database. But the data is not begin saved.</p>
  
  <p>When I consult the SQL Server database (<code>Select top 1000 rows</code>), nothing is showing.</p>
  
  <p>What part of the code is not working, the C# or the SQL? I'm using a console command for the inputs.</p>
  
  <p>My class <code>Neighborhood</code>:</p>
  
  <pre><code>private string name;
  private string description;
  
  public string Name { get { return name; } set { name = value; } }
  public string Description { get { return description; } set { description = value; } }
  
  public Neighborhood(string name, string description)
  {
      this.Name = name;
      this.Description = description;
  }
  
  public Neighborhood(){}
  
  public bool Save()
  {
      bool retor = false;
      string strCon = "Data Source=FACUNDO\\USARESTESQLSERVE; Initial Catalog = TestDB; Integrated Security = SSPI; ";
  
      SqlConnection con = new SqlConnection(strCon);
  
      string insert = "INSERT INTO Neighborhood (Name, Description) VALUES (@nom, @desc);";
  
      SqlCommand command = new SqlCommand(insert, con);
      command.Parameters.AddWithValue("@nam", this.Name);
      command.Parameters.AddWithValue("@desc", this.Description);
  
      try
      {
           con.Open();
           retor = true;
      }
      catch
      {
           retor = false;
           throw;
      }
      finally
      {
           if (con.State == ConnectionState.Open) 
                con.Close();
      }
  
      return retor;
  }
  </code></pre>
  
  <p>And this is the SQL code</p>
  
  <pre><code>CREATE DATABASE TestDB
  
  USE TestDB
  
  CREATE TABLE Neighborhood 
  (
      Name VARCHAR(30) NOT NULL,
      Description VARCHAR(50) NOT NULL,
      CONSTRAINT PK_Neighborhood PRIMARY KEY (Name) 
  )
  </code></pre>