I am posting my answer because all that offered solutions I did not give up!
I made this call to my Class Library Form and got a obj list back.
And populated the rows of the DataGridView.
public void loadDGV()
{
frmHDB form = new frmHDB();
{
form.readData(list);
foreach (string str in list)
{
dgvPerson.Rows.Add(list[i], list[i + 1], list[i + 2]);
i = i + 3;
dgvPerson.Sort(dgvPerson.Columns[2], ListSortDirection.Ascending);
}
}
}
Here is the code in the Class Library that gets data from the SQLite Database
public List<object> readData(List<object> list)
{
using (SQLiteConnection conn = new SQLiteConnection($"Data Source = '{dbName}';Version=3;"))
{
conn.Open();
using (SQLiteCommand cmd = new SQLiteCommand($"SELECT * FROM FriendsData", conn))
{
using (var rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
gv_parentInt = rdr["FID"].ToString().Trim();
list.Add(gv_parentInt);
gv_firstName = rdr["fxFirstName"].ToString().Trim();
list.Add(gv_firstName);
gv_lastName = rdr["fxLastName"].ToString().Trim();
list.Add(gv_lastName);
}
}
}
}
return list;
}
I am not too sure about the i = i + 3 counter but it works