我正在尝试使用掌上电脑模拟器构建应用程序... 我的目标是连接到另一台PC上的sqlserver express db 请注意,在一个简单的桌面程序中一切正常,但在智能手机程序中,运行此代码时:
SqlConnection DatabaseConnection = new SqlConnection(@"Data source=SERVER\SQL2008;Initial Catalog=myDatabase;Persist Security Info=True;User ID=myUser;Password=myPassword");
DatabaseConnection.Open();
当调用Open时,这是错误消息:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Connect(String host, SqlInternalConnection connHandler, Int32 timeout)
at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
at System.Data.SqlClient.SqlInternalConnection..ctor(SqlConnection connection, Hashtable connectionOptions)
at System.Data.SqlClient.SqlConnection.Open()
可能的错误在哪里? 连接字符串到桌面应用程序工作,智能手机模拟器找到“\ SERVER”PC ...
任何想法?