By default, one form doesn't have access to controls on another form. You started resolving the issue with your code
but you commented it out. Instead of referring to frmMain's .Value property, you can create a public variable or property of frmMain and set it at this point; then reference it within frmMain's buttonGDN_Click event.
An alternative method would be to qualify your reference to txtUsername when you refer to it; however, you'd need to locate the right form in order to get a reference to it. (Suppose there was some situation where buttonGDN_Click was invoked, but frmLogin was no longer open, or there were multiple instances of it). This would be relatively tricky, and you'd still need to deal with cases where the form wasn't open or there were multiple instances (in your app, it *might* be a safe assumption that there would always be one instance of frmLogin open, but
I can't assume that, and it might change in the future).
So your best bet is to create either a public property of frmMain, or a publicly-accessible variable:
public string Username = string.Empty;
Then your frmMain opening code becomes
frmMain objFrmMain = new frmMain();
objFrmMain.Username = txtUsername.Text;
objFrmMain.Show();
Finally, as so often, your application is wide open to a SQL Injection attack (or just accidental error / damage) as a result of just in-lining your form variables when building your SQL to check username. Anyone entering a single apostrophe in their username either breaks your code, or breaks into your database. Always parameterise any SQL query that includes user-entered text.