this stuff is giving me build error, where am i supposed to slap it ( what platform in visual studio) pls

one thing i am not clear. let say everything is ok and a user successfull to login. From above code we get it in this part.

if (string.Compare(dbPassword, appPassword) == 0)
{
//Logged in
}

my question is what we do with the login form unload and load the main form?

if (string.Compare(dbPassword, appPassword) == 0)
{
//Logged in
this.hide();
mainForm.show();
}

how we manage the login form and mainform and there exit sequence?

FYI, when talking about secure logins, providing any information on the validity of either the userID or the password is a complete no-no. Instead of just passing the userID, pass both the userID and the encrypted password to the connection making sure both are part of the where clause.
It's beyond the scope of this routine, but it is a good practice to just allow the general user execute access to stored procedures, so this should call a procedure that returns the logon information information you want to retrieve.

I like this function. Thanks

first program is not run because it has no main method ??
pls give solution

It's not a fully functional program, it's part of a form's code.