下面两行程序在console application上运行成功,但在web service proxy里面却不行。
为什么?
SqlConnection ucidConn = new SqlConnection("Data Source=localhost\\MYSQLENGINE
; database=xxx; Integrated Security=SSPI;Initial Catalog=xxx");
ucidConn.Open();
in proxy: (suppose above codes is class A method B)
[WebMethod]
a = new A();
a.B()
结果抛出异常:
System.Data.SqlClient.SqlException: Login failed for user 'ItIsMe'.
如果用管理员账户,即用uid=sa;pwd=;代替Integrated Security=SSPI,则是:
System.Data.SqlClient.SqlException: Login failed for user 'sa'.