开发者

sql connection on c# smartdevice application

I'm trying do build an application using the pocket pc emulator... My goal is to connect to a sqlserver express db placed onto another pc note that in a simple desktop program everything works fine, but in the smartphone program, when this code is run:

SqlConnection DatabaseConnection = new SqlConnection(@"Data source=SERVER\SQL2008;Initial Catalog=myDatabase;Persist Security Info=True;User ID=myUser;Password=myPassword");
DatabaseConnection.Open();

and when the Open is called, this is the error message:

   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()

where is the possible error? the connectio开发者_如何学Pythonn string into a desktop app works, the "\SERVER" pc is found by the smartphone simulator...

any ideas?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜