3
Answers

Efficient ways to reset lost sql sa password

Photo of yee lau

yee lau

14y
9.9k
1
Have you ever forgot or lost your SQL Server sa password? Did you hava any ideals to reset your lost sa password? Or choosed to reinstall MS SQL Server on your PC again? I once forgot my SQL sa password and I reinstalled SQL Server at last, because I failed to find some good methods to solve the problem. What annoying and terrible experience it is! In order to avoid reinstalling SQL Server for a second time, i collect some methods and try them by myself, to reset SQL Server Password for sa account.

Method 1: Reset SQL Server sa password by Windows Authentication

If Builtin/Administrator is present in SQL Server, you can login with an ID which is member of Administrators group and reset sa password in SQL Server. Just do as follows:

Step 1. Login into SQL server using Windows Authentication.
Step 2. In Object Explorer, open Security folder, open Logins folder. Right click on sa account and go to Properties.
Step 3. Type a new SQL sa password, and confirm it. Click OK to finish.

Answers (3)

0
Photo of Muralidharan Deenathayalan
NA 11.9k 1.5m 13y
Please find the attached. It is a complete solution for your question.


Kindly let me know, if you have any issues.
Accepted
0
Photo of saifullah khan
NA 304 237.7k 13y
great sir very very great.it is 100% correct
0
Photo of Abhimanyu K Vatsa
NA 50.9k 12.4m 13y
excellent attachment Murali. saifullah go with murali, this is also one of the nice way.
0
Photo of Muralidharan Deenathayalan
NA 11.9k 1.5m 13y

You want the cascading dropdownlist .

http://www.asp.net/ajax/ajaxcontroltoolkit/samples/CascadingDropDown/CascadingDropDown.aspx
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/walkthrough/ccdwithdb.aspx
http://www.aspsnippets.com/Articles/Creating-Cascading-DropDownLists-in-ASP.Net.aspx
0
Photo of Abhimanyu K Vatsa
NA 50.9k 12.4m 13y
Job1

for the very first dropdown (province) bind the all database record (you have 4 records). Code would be something like,

<asp:DropDownList
        id="DropDownList1"
        DataSourceID="SqlDataSource1"
        DataTextField="province"
        DataValueField="ID"
        Runat="server" AutoPostBack="True" />
</br>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString1 %>"
            ProviderName="<%$ ConnectionStrings:DatabaseConnectionString1.ProviderName %>"
            SelectCommand="SELECT [ID], [province] FROM [tblprovince]"></asp:SqlDataSource>

Note: remember to mark autopostback enabled. 

Job2

Use the code in the code-behind for selectedIndexChenged event of above dropdown.

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
         //here you have to place the binding data of division drop down
         
    }


i hope this helps






0
Photo of saifullah khan
NA 304 237.7k 13y
sir i have two questions here.
1. should i bind both of the dropdowns to division table?
2. could you please tell me query?
0
Photo of Abhimanyu K Vatsa
NA 50.9k 12.4m 13y
You have to bind the dropdown control to your database. and execute some queries via dropdown change. 

Refer this post http://www.vbdotnetheaven.com/UploadFile/abhikumarvatsa/2333/