password encrypation in sqlserver

Posted by Saisindura under ASP.NET on 3/1/2012 | Points: 10 | Views : 963 | Status : [Member] | Replies : 5
Hi all

my query is
string query = "insert into siteuser(user_id,password)values('" + TextBox1.Text.Trim() + "',Convert(varbinary(50),'" + TextBox2.Text.Trim() + "'))";

after executing password is not stored in encrypted format in sqlserver.
It shows <Binary Data> in password column.
why?

Thanks&Regards
srisai



Responses

Posted by: Blessyjees on: 3/1/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi,

In your query you have convert the password to varbinary, so it shows as binary data in password column.

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saisindura on: 3/1/2012 [Member] Starter | Points: 25

Up
0
Down
Hi mam

Thanks for reply
For this how to store password *** format.

Thanks&Regards
srisai

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saisindura on: 3/1/2012 [Member] Starter | Points: 25

Up
0
Down
string query = "insert into siteuser(user_id,password)values('" + TextBox1.Text.Trim() + "',Convert(varbinary(50),'" + TextBox2.Text.Trim() + "'))";
If i use the above one password is not stored .it shows in <binary data> in password column in sqlserver.
for retrieving the password .password column is empty.

if iam not using varbinary in above query it shows the bellow error
Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query.

how to store password *** format in sqlserver.

Thanks&Regards
srisai

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 3/1/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi sai,

follow this URL
http://forums.asp.net/t/1003141.aspx/1

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Saisindura on: 3/1/2012 [Member] Starter | Points: 25

Up
0
Down
Hi
Thanks for replies.
I solved my problem.

Thanks&Regards
srisai

Saisindura, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response