我有以下代码
SqlConnection conn = new SqlConnection("user id=clearpath\\user;" +
"password=Password1;server=sqldatamart;" +
"Trusted_Connection=yes;" +
"database=LENDER_LOAN_SERVICE;" +
"connection timeout=30");
SqlCommand cmd = new SqlCommand("INSERT INTO [LENDER_LOAN_SERVICE].[CMC].[Turn_Times] values('"+dateadded+"','"+username+"','"+prevtime+"','"+type+"','"+newturntime+"')",conn);
conn.Open();
当我进行本地开发时,效果很好。但是,当我将网站放在计算机上的 IIS 6 上时,出现以下错误。
Login failed for user 'CLEARPATH\IT-CARLOSDELL$'.
Line 42: SqlCommand cmd = new SqlCommand("CMC.sp_NewDocMod", conn);
Line 43:
Line 44: conn.Open();
Line 45:
Line 46: SqlDataReader reader = cmd.ExecuteReader();
第 44 行出现错误。
似乎它将连接字符串从 clearpath\cpereyra 更改为 clearpath\IT-CARLOSDELL$
我的电脑名称是 IT-CARLOSDELL
有想法该怎么解决这个吗?
谢谢