Click here to Skip to main content
15,889,211 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi all, i have created small windows application and connecting sql server 2005 from my windows mobile application
while establish the connection i am getting that platform not supported.

C#
System.PlatformNotSupportedException was unhandled
  Message="PlatformNotSupportedException"
  StackTrace:
    at System.Text.Encoding.GetDataItem()
    at System.Text.CodePageEncoding..ctor()
    at System.Text.Encoding.GetEncoding()
    at System.Data.SqlClient.TdsParser.ProcessEnvChange()
    at System.Data.SqlClient.TdsParser.Run()
    at System.Data.SqlClient.TdsParser.Run()
    at System.Data.SqlClient.SqlInternalConnection.Login()
    at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
    at System.Data.SqlClient.SqlInternalConnection..ctor()
    at System.Data.SqlClient.SqlConnection.Open()
    at DeviceApplication1.Form1.button1_Click()
    at System.Windows.Forms.Control.OnClick()
    at System.Windows.Forms.Button.OnClick()
    at System.Windows.Forms.ButtonBase.WnProc()
    at System.Windows.Forms.Control._InternalWnProc()
    at Microsoft.AGL.Forms.EVL.EnterMainLoop()
    at System.Windows.Forms.Application.Run()
    at DeviceApplication1.Program.Main()


and this is my code here


C#
SqlConnection conn = null;
 string conString;

conString ="Data Source=192.168.100.11;Initial Catalog=PDA;Integrated Security=SSPI;User ID=mydomain\\usewrid;Password=mypassword";

conn = new SqlConnection(conString);
conn.Open();


i am getting error in this line of conn.open();


how to fix this error.
Posted
Updated 1-Feb-12 23:16pm
v3

The collation of your database is not supported on the WinCE/Windows Mobile device you are using, i.e. it's missing the codepage from the build. You should be able to test it by changing to collation to something else on server side, for example SQL Latin or similar.

I saw the same situation with a WinCE 6.0 device where connecting to a DB with "Latin1_General_CI_AI"-collation succeeded but connecting to a DB with "Romanian_CI_AS" failed. The problem was eventually solved by acquiring an update for the WinCE image where the required codepage 1520 was added. Another option is just to change the database collation to something that is supported on your handheld device.
 
Share this answer
 
v2
May be you are trying to connect to the wrong flatform, you have to connect to the
SqlCE[^]. for Compact Framwork.

Thanks
--RA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900