Did you find that code in several places on the internet, and decide to bolt it together and hope it would work? Because that is certainly what it looks like...
That code won't work.
You need to go back a stage or two and rethink how you are doing things here: start by reading this:
Password Storage: How to do it.[
^] which "prepares" passwords for you to store and compare, then try this:
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand cmd = new SqlCommand("SELECT password FROM myTable WHERE UserName=@UN", con))
{
cmd.Parameters.AddWithValue("@UN", usernameTextBox.Text);
using (SqlDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
byte[] password = (byte[])reader["password"];
}
}
}
}