2014年6月11日星期三

SQL SERVER 2008 r2 sa和windows账号都无法登录

处理方式:
  1. 停止正在运行的sql server服务;
  2. 在cmd中切换到sql server目录中的Binn目录(如果这个路径在path环境变量中不切换也行),运行sqlservr.exe -m,注-m为单用户模式的参数,这个cmd窗口不能关闭;
  3. 新打开一个cmd窗口,执行如下语句,如果你知道是什么意思,这一步可以用Microsoft SQL Server Management Studio来代替,(以下操作sqlcmd.exe所在路径在path环境变量中):
    C:\Users\Administrator>sqlcmd
    1> create login tempsa with password='tempsa@123'
    2> go
    1> sp_addsrvrolemember 'tempsa','sysadmin'
    2> go
  4. 关闭这两个cmd窗口,启动sql server服务,使用上一步创建的用户登录,重置/修改一下sa的密码,这时sa就可以登录了

2014年6月6日星期五

System.ServiceModel.Activation.HttpModule

.NET 安装的顺序应该是先装 IIS,再装 VS.NET,如果次序反了,或者 IIS重装了,就需要使用aspnet_regiis.exe -i 来重新安装 IIS Mapping(主要用于aspx, asmx等文件的 Extention 的匹配)。在 C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705 目录下,运行下面的命令:aspnet_regiis.exe -i。


报错:不能加载 
System.ServiceModel.Activation.HttpModule
Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′.Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more inform ation about the eraaaaaror and where it originated in the code. Exception Details: System.TypeLoadException: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′.

解决方法:
使用命令: c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru