You use opened datareader and execute command at the same time.
In this case you could replace following block of code:
SqlCommand cmd = new SqlCommand("select * from account",con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read().Equals(textBox1.Text))
With something like this:
var cmd = new SqlCommand("SELECT COUNT (*) FROM [account] WHERE fieldname = @fieldname",con);
cmd.Parameters.AddWithValue("@fieldname", textBox1.Text);
var isExists = Convert.ToInt32(cmd.ExecuteScalar()) > 0;
if (isExists)
This will solve problem, just replace "fieldname" with name of field in db table to which you compare textBox1.Text.
Some small recommendations:
1. Do not use non-prepared strings in your sql queries (problem of sql-injection). Use parameters instead;
2. Store connection string in application configuration file in <connectionstrings> section;
3. Provide more attention to disposable resources. In case of any problem in try block db connection will stay open;
4. Use string.Format or StringBuilder for string concatenation;
If it's just test project or example then never mind :)