you never initialize form2, which makes it cause a nullreference on this line:
DataTable dt2 = form2.db.GetData();
You should do something like
form2 = new Form2();
Depending on where you need it.
public partial class Form3 : Form
{
private Form2 form2; // <--- you never initialize form2
public Form3()
{
InitializeComponent();
loadData();
}
public void loadData()
{
//UNHANDLED EXCEPTION HERE
DataTable dt2 = form2.db.GetData();
dgvScore.DataSource = dt2;
}
}