开发者

Connect to SQL Server named instance from Windows CE

开发者 https://www.devze.com 2023-02-08 15:41 出处:网络
I have a working connection string I stole from my desktop application, 开发者_如何学编程 Data Source=Timber\\Test2;User ID=****;Password=****;

I have a working connection string I stole from my desktop application,

开发者_如何学编程
Data Source=Timber\Test2;User ID=****;Password=****;
Initial Catalog=UTIL;Application Name=Handheld Shipping;Connect Timeout=1 

which just connects to a named instance on SQL Server for testing. When I use the same connection string in my Windows CE application, I get a SqlException, Specified SQL server not found: Timber\Test2.

Is this a limitation of the SQL client in .NET Compact? Or does the connection string need to be in a different format for the Compact client?

The device I'm using is CE6.0 and my program is .NET Compact 3.5.

EDIT: I'm connecting to a SQL Server 2008, on Server 2008. Connecting to the default instance works, just not the named instance.


No there's no limitation on the CE connection. In fact the only thing different between the CE connection and the desktop is that a CE device can do something that a desktop can't. Pass the user name and password using Integrated Security.

Data Source=myServerAddress;Initial Catalog=myDataBase;
  Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;

see Trusted Connection from a CE device

The problem is probably that the CE device can't see Timber\Test2 due to a network issue. Try Pinging Timber from your CE Device

0

精彩评论

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

关注公众号