Cannot connect to SQL Server 2008 from VB.NET application running on WEC 7

I’d like to connect to database of SQL Server 2008 R2 running on Windows PC from VB.NET application running on WEC 7.

I attempted to connect to the server using SqlConnection class (System.Data.SqlClient.dll).

But the exception occurred. (PlatformNotSupportedException)

What should I do ?

Environment

  • Colibri i.MX6 (Iris Board)
  • WEC7 v1.1 release
  • Installed .NET CF 3.5
  • Installed SQL CE
  • Copied “System.Data.SqlClient.dll”
  • Copied “dbnetlib.dll”

I referred to the following page.

http://developer.toradex.com/knowledge-base/how-to-use-sql-database-in-vcsharp

Can you try to follow those steps:
https://social.msdn.microsoft.com/Forums/en-US/a751af33-41de-4018-86a6-0c2ebf17410d/how-do-i-connect-to-a-desktop-sql-server-database?forum=netfxcompact
and let us know if that fixes your issue?

I tried, but the same exception occurred.

SQL Server Collation is Japanese_CI_AS.
Is Japanese locale not supported?

Issue seems to be related to cultureinfo and DB collation, did you change default language or locale settings for your device? Is the default locale of your DB set to something other than English?

WEC7: Default locale is english.
SQL Server 2008 R2: Language is japanese. Collation is Japanese_CI_AS.

Is it necessary to match the language environment between the device and the DB server?
The WEC 7 OS image does not seem to support the Japanese locale.

You may need to build your own image or to get in touch with our Japanese office to check if they have an image for your module/OS version that you can use to test if this solves the issue.

It seems that when the DB is using a different locale the local application is trying to match it, so you may need to build your own image, starting from our BSP and sample workspace, and add support for Japanese (you may need to add locale but also fonts).

Thank you for your answer. I tested it by changing the locale of DB to English and it ran without problems.I will build WEC7 OS image with Japanese locale added.

Ok, this seems to be the right solution, let us know if you have any issue building your image. I suggest starting from our sample workspace, adding just the components related to Japanese locale and language, then you may optimize it removing components you don’t need and, if you see it fit, integrating the .NET Compact Framework in the image.

Thank you for your help. I tested it using WEC7 with Japanese locale added and it ran without problems.

Thank you for your help. I tested it using WEC7 with Japanese locale added and it ran without problems.