public void Add(Note note) { using (var connection = new SqlConnection(_connectionString)) { var command = new SqlCommand("INSERT INTO [Notes] (Author, CreationDate, Content) VALUES (@Author, @CreationDate, @Content)", connection); command.Parameters.Add(new SqlParameter("@Author", note.Author)); command.Parameters.Add(new SqlParameter("@CreationDate", note.CreationDate)); command.Parameters.Add(new SqlParameter("@Content", note.Content)); connection.Open(); command.ExecuteNonQuery(); } }
public void AddNote(Note note) { Dao.NoteAccess.Add(note); }