程序移植后数据库链接出错,怎么办?
我将做好的asp.net程序从开发机移植到服务器上运行,运行出错
出错提示:
SQL Server does not exist or access denied.
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.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 69: string sqlstr; //sql语句
Line 70: sqlstr="select * from t_admin where UserID="+"'"+username+"'"+" and passwd="+"'"+password+"'";
Line 71: myconn.Open();
Line 72: SqlCommand cmd=new SqlCommand(sqlstr,myconn);
Line 73:
71行出错
我检查了数据库链接代码没有错误,
请大家帮我解决这个问题。