:laugh:
Hello again...
For starters, don't do it like that - you are committing two of the worst sins it is possible to commit (and a couple of poor ideas to add to it).
The first Sin is concatenating strings to form an SQL command:
SqlStr = " select LoginName,LoginPass ";
SqlStr = SqlStr + " from Login";
SqlStr = SqlStr + " where LoginName='" + TxtUserName.Text + "' AND LoginPass='"+TxtPassword.Text+"' ";
I know you know about parameterized queries, because you use them elsewhere!
Concatenating strings is extremely dangerous: Google "Bobby Tables" and see what I mean. Users can damage or destroy your database if you do that...
The second Sin is storing passwords in clear text: this is bad...very bad...
Code Crime[
^]
There is a tip here which may help:
Password Storage: How to do it.[
^]
The first poor idea is adding strings together at all: learn to use a StringBuilder instead - it's a lot more memory efficient (remember, strings are immutable, so whenever you add to a string, you create a new one that is longer).
The second poor idea is using default names: 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...you've done it most of the time, but not for your login for, or "Form2"...