title: insert value from TextBox into sql
body: <p>I'm getting this error message: Cannot insert the value NULL into column 'id', table ''; column does not allow nulls. INSERT fails. thanks in advance</p>
  
  <pre><code>   protected void AddItem(object sender, EventArgs e)
     {
  
          string insertCmd = "INSERT INTO Picture (Album, id) VALUES (@Album, @id)";
          using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["strConn"].ConnectionString))
          {
              conn.Open();
              SqlCommand myCommand = new SqlCommand(insertCmd, conn);
              // Create parameters for the SqlCommand object
              // initialize with input-form field values
              myCommand.Parameters.AddWithValue("@Album", txtAlbum.Text);
              myCommand.Parameters.Add("@id", SqlDbType.Int).Direction = ParameterDirection.Output;
              myCommand.ExecuteNonQuery();
  
              int id = (int)myCommand.Parameters["@id"].Value;
          }
      }
  </code></pre>