Sunday, February 19, 2012

Connecting Database Engine (SQl server 2005 file .*mdf) from Win CE 5.0 platform

Is this possible to connect do the Database Engine (on sql server 2005 on XP platorm - file *.mdf (not mobile *.sdf)) from win CE 5.0?

I tried to do this :

ConnectionStringSQLServerCE = "Data Source=WORK_STATION\\SQLEXPRESS;Initial Catalog=dbMachines;Integrated Security=False;Password=Panel;User ID=Panel";

SqlCeConnectionCE = new SqlConnection(ConnectionStringSQLServerCE);

SqlCeConnectionCE.Open();

but I catch error:

catch (PlatformNotSupportedException ex)

?PlatformNotSupportedException”

I noticed that I see server because when I use:

ConnectionStringSQLServerCE = "Data Source=WORK_STATION\\SQLEXPRESS";

zwraca b??d typu

catch (SqlException ex)

“Login failed for user ''. The user is not associated with a trusted SQL Server connection.”

I used

using System.Data.SqlClient;

from Compact Framework 2.0 under Visual Studio 2005 Device Application Windows CE 5.0

can anyone help me?

Yes, it is possible to connect to SQL Server 2000/2005, SQL Express and MSDE from NETCF application using SQL Client.

PlatformNotSupportedException usually happens if particular device does not support locale database it in. For example, if your database uses Polish collation, you'd need device localized in Polish in order to use it. Alternatively you could change database collation to one available on device.

As to connection issue, your server need to be properly configured and you should have functional network connectivity. Please see this for general troubleshooting:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=335660&SiteID=1

No comments:

Post a Comment