When you posted this code earlier:
System.Data.SqlClient.SqlExcep...[
^]
I explained that that was what the code your were using was going to do:
string checkuser = " select count(*) from UserDetail where UserName='" + TextBoxUN + "'";
And that you should change it to:
string checkuser = " select count(*) from UserDetail where UserName='" + TextBoxUN.Text + "'";
But that was dangerous and you should use Parametrised queries instead.
Not that you should use the class name directly...:sigh:
Please, start to think about what you are doing? Please?