Assigning roles automatically in registration page
<p>I have simple registration page, wherein after submitting the contents (Username and Password) of the page,  I need to assign the User with a role. 
I have created 2 roles (Admin and member) from WSAT GUI.. </p>

<p>So how'd I assign him with the "member role"</p>

<p>This is my registration form.. </p>

<pre><code>protected void Button1_Click(object sender, EventArgs e)
    {
        string EPass = Helper.ComputeHash(TextBox2.Text, "SHA512", null);
        String var = System.Configuration.ConfigurationManager.ConnectionStrings["KKSTechConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(var);
        String str = @"insert into Users (Username, Pass, EmpID, Rolename)
                                    values(@Username, @Pass, @EmpID, @Rolename)";
        SqlCommand cmd = new SqlCommand(str, conn);
        cmd.CommandText = str;
        cmd.CommandType = CommandType.Text;

        try
        {
            var userName = TextBox1.Text;
            conn.Open();
            cmd.Parameters.AddWithValue("@Username", TextBox1.Text);
            cmd.Parameters.AddWithValue("@Pass", EPass.ToString());
            cmd.Parameters.AddWithValue("@EmpID", DropDownList1.SelectedValue);
            cmd.Parameters.AddWithValue("@Rolename", DropDownList2.SelectedValue); 
            cmd.ExecuteNonQuery();


        }

        finally
        {
            conn.Close();
        }

    }
</code></pre>

<p>dbo.Users:
Username(PK) | Pass | EmpID (FK) | Rolename</p>
