For starters, don't do it like that!
There are so many things wrong here it's difficult to know where to start!
Let's go with the really big one: SQL Injection.
Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead. See here:
xkcd: Exploits of a Mom[
^]
The second one is nearly as big: Never store passwords in clear text - it is a major security risk. There is some information on how to do it here:
Password Storage: How to do it.[
^].
See here:
http://www.commitstrip.com/wp-content/uploads/2013/09/Strips-Erreur-au-pilori-001-650-finalenglish.jpg[
^]
Next, don't hardcode connection strings. They make it very difficult to test your code before you release it to production! Use settings or configuration files instead.
Now we get to the problem you have noticed.
Form6 obj = new Form6();
Form1 objform1 = new Form1();
obj.Show();
objform1.Visible = false;
objform1.Hide();
visiblemethod();
Why are you creating a new instance of a form in order to hide it, when it is never displayed?
Try this instead:
Form6 obj = new Form6();
obj.Show();
Hide();
visiblemethod();
That will hide the current instance of the form - i.e. the one the user typed in - rather than a brand new one...
BTW: Do yourself a favour, and stop using Visual Studio default names for everything - you may remember that "TextBox8" is the mobile number today, but when you have to modify it in three weeks time, will you then? Use descriptive names - "tbMobileNo" for example - and your code becomes easier to read, more self documenting, easier to maintain - and surprisingly quicker to code because Intellisense can get to to "tbMobile" in three keystrokes, where "TextBox8" takes thinking about and 8 keystrokes...