Click here to Skip to main content
13,046,375 members (69,347 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all

I am using PasswordBox for entering the password..but while entering into database its giving me error in below lines

txtAdminPass.Text = dt.Rows(0)("AdminPass").ToString()
txtAdminConfirmPass.Text = dt.Rows(0)("AdminConfirmPass").ToString()

it's telling Text property is not associated with PasswordBox

Please tell me how to do this..or else is there any way to make the textbox as a password box

Thank you
Posted 9-May-13 2:06am
Updated 9-May-13 2:57am
ThePhantomUpvoter 9-May-13 8:41am
If you had read the documentation for the PasswordBox, you would have known that the property that you wanted was the Password property not the Text property.
Code-Hunt 9-May-13 8:57am
i know that..but then is it now possible to enter the value of password box to database...??
ThePhantomUpvoter 9-May-13 9:24am
That wasn't your question now was it? If you knew that then why did you ask? What is the problem with your database? Can you not write a connection string? Do you not know how to connect to whatever database you are using? Did you do any research at all? Can you not write an INSERT or UPDATE statement? Do you not know how to executee a SQL statement?
Code-Hunt 9-May-13 9:27am
try to read before asking this much questions...all others are clear about the question apart from you
pdoxtader 9-May-13 9:58am
He's asking where your stuck - what it is you're having trouble with. Be specific. We'll give you code examples if we know what your having trouble with... but we're not going to write your application for you.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi Code-Hunt,

I believe you have selected the text property instead of "Password" property

Try this line

txtAdminPass.Password = dt.Rows(0)("AdminPass").ToString()
txtAdminConfirmPass.Password = dt.Rows(0)("AdminConfirmPass").ToString()

It would help you to resolve the issue.

CPallini 9-May-13 8:49am
I guess you are right: 5.
rk_prabakar 9-May-13 8:51am
Thanks Pal....
Code-Hunt 9-May-13 8:56am
@rk_prabakar: No thats not the case..i may be pasted this by mistake..i just want to know to save the data of passwordbox as it dont have text property
pdoxtader 9-May-13 8:58am
ThePantomUpvoter told you... no? He said that the property you needed was the Password property, not the Text property. Have you tried that out? He also wrote that you should have read the documentation for PasswordBox... and while I don't necessarily agree with beating people up for asking questions... he's right.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

PasswordBox.Password did the work for me...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100