Tuesday, March 6, 2012

"Encrypt" argument not supported in CF 2.0 Sqlconnection.ConnectionString

Is "Encrypt" not support in Compact Framework 2.0 SqlConnection string?

Trying to connect to sql2005 db using SSL from WM5/.net 2.0 pda and am receiving the below error. I can connect fine w/o the "encrypt" argument and the same connection string with "encrypt" connects fine from XP workstation to sql db w/SSL.

"Unknown connection option in connection string: encrypt."

Connection String I used:

sqlConnection = new SqlConnection("Data Source=mysqlserver;Initial Catalog=sometable;UID=username;PWD=Password;Encrypt=true;");

Thanks,

Jim

Hello everybody

I have the same problem. I'm using mobile PC with WinCE 4.2 on board. And I need the connection to be encrypted. How can I make this? The CF1.0/2.0 doesn't allow this feature. :(

Also I can use the VPN connection. But my device doesn't have this function (the function is present in disable mode). May be there is another application that realize VPN for WinCE 4.2?

Thank you.

Best regards,

Sergey

|||

This works in my code. I'm showing you the function that calls GetConnectionString so you'll see where the string is being passed.

Public Shared Function GetConnection(ByVal strDatabaseName As String) As SqlCeConnection

Dim cn As SqlCeConnection

cn = New SqlCeConnection(GetConnectionString(strDatabaseName))

Return cn

End Function

Public Shared Function GetConnectionString(ByVal strDatabaseName As String) As String

Return "Data Source=" & strDatabaseName & ";SSCE:Database Password=xxxxxxxx;SSCE:Encrypt Database=True"

End Function

|||

Why did you write the 'ssce' near connection string properties? Is it rule or something else?

Also, I need connect to the Sql Server on the host (not mobile sql server) and I use the SqlConnection class for it. Can I use such connection string? I didn't find the information in the msdn about its description.

Sorry, but I can't check your advise now and see the result, I'm away from my workstation. That is why I want to know more. And I'll check it latter.

|||

To Clearify - I'm trying to encrypt the sql connection to the host using, not to a local installation of SQL Mobile. I believe a couple of replies address encrypting data or the database of a local sql mobile db.

Jim

|||Sorry, I did not notice you were not using sqlce.|||This means that Encrypt is not supported in Compact Framework 2.0 SqlClient.SqlConnection|||

This code sample does not work on a WM 5 device with cf 2.0 but works ok if "Encrypt=true" is removed. Am I doing something wrong? Same code works fine on XP with .Net 2.0 when connecting to same ssl enabled sql server. How can I encrypt a sql connection from pda to sql server?

Thanks,

Jim

sqlConnection = new SqlConnection("Data Source=someSql2005Server;Initial Catalog=someSqlTable;"

+ "UID=myUsername;PWD=somePassword;Encrypt=true");

|||The compact framework is not the full .NET framework. Some features are disabled or just not implemented. If you get an error that the connection could not be established because of the encrypt feature not being available it's just not implemented!

No comments:

Post a Comment