That part returns 'null' because it's not properly connecting to the database as the picture states. 'Connection' is null and when you try to access the 'State' it'll throw that error. Check the Connection string, also I believe that in the database you will find something like
Code:
string Username = "USERNAME";
string Password = "PASSWORD";
You will have to change those to match your MySQL login information.