30-4-2011 9:9:32
Bạn không biết cấu hình SQL Server 2005/2008 rồi. SQL có 2 mode
1/ đăng nhập = tài khoản window
2/ đăng nhập = account sql server
Với mỗi loại sẽ có các loại connection string như sau
1/ Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;
2/ Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
Hiện tại bạn đang dùng kiểu 2.
Nhưng khi cài đặt SQL 2005/2008 bạn lại chỉ chọn mode Window Authentication chứ không chọn kiểu SQL Server Authentication.
Nếu bạn chưa active tính năng này lên bạn sẽ bị lỗi sai đăng nhập.
Để giải quyết bạn làm như sau :
1/ In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
2/ On the Security page, under Server authentication, select the new server authentication mode, and then click OK.
3/ In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
4/ In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.
---
Coding for food
http://yenbai.awas.vnhttp://tknd.vnhttp://coder.awas.vnhttp://awas.vnhttp://sonla.gov.vnhttp://evnhanoi.com.vnhttp://www.hup.edu.vn