private void Form1_Load(object sender, EventArgs e) { try { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Title", typeof(String)); dt.Columns.Add("Content", typeof(String)); List <NoteModel> nmList = DBCalls.retrieveAllNoteInfo(); foreach (NoteModel nm in nmList) { dt.Rows.Add(nm.Id, nm.Title, nm.Content); } dataGridView1.DataSource = dt; }catch (Exception err) { Console.WriteLine(err); } }