Suppose your database contains field called username,then you can check if username exist in the database or not,if not then enter the details else throw an exception.Example is given below.
SqlConnection conn = new SqlConnection();
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["connection string name"].ConnectionString;
conn.Open();
String user=TextBox1.Text;
SqlCommand check = new SqlCommand("select * from table_name where name=@user", conn);
cmd.Parameters.Add(new SqlParameter("@user",user));
SqlDataReader reader = check.ExecuteReader();
if (!reader.Read())
{
}
else
{
}