Posted on: 4/3/2012 7:07:50 AM | Views : 386

hello there,
i am very new in SQL. i am creating a website in asp.net. i want to create a login page for administrator to enter new items and prices.
how i can store its password in encrypted form and how i can select and can decrypt when i want to authenticate.
here is my line of code to check valid user.
where UserName and Password are TextBoxes.

SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["abcCS"].ConnectionString); 
conn.Open();
string strName = "select count(*) from users where user_id='" + UserName.Text + "' AND user_pass='" + Password.Text + "'"; 
SqlCommand checkUsers = new SqlCommand(strName, conn); 
int temp = Convert.ToInt32(checkUsers.ExecuteScalar().ToString()); 
if (temp == 1) {
Session["userName"] = UserName.Text;
Re ...

Go to the complete details ...