Get the user to type the password into a TextBox
Postback
Build up a ConnectionString including the contents of the TextBox
Instantiate an ADO.NET Connection object using the ConnectionString
Try to open the Connection and trap for any SQL Server errors
try to connect to SQL Server. If you are able to connect, the password is
correct.
Some apps don't try to connect. In those apps, they usually ask the user to
enter the password twice, and then they store the password encrypted until
it is needed.
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
I guess a person could catch the SqlException and see what it says for a
known bad password - and then handle it that way. But also handle it
appropriately if the server isn't found, the name can't be resolved or if
the wrong provider is specified, etc..
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.