Compartilhar via


Devices and Data Access 

When you program applications to access data within the .NET Compact Framework, consider the following:

  • The .NET Compact Framework does not support the following classes:

    System.Data.OleDb namespace

    System.Data.SqlClient.SqlClientPermission class

    System.Data.SqlClient.SqlClientPermissionAttribute class

  • Because of size and performance considerations for devices, the .NET Compact Framework does not support the functionalities described in the following table.

    Unsupported Functionality Remarks

    Connection pooling

    A device can have only a small number of connections to an instance of SQL Server at any time.

    Distributed transactions

    Transactions cannot span databases or servers. System.Data.SqlClient generates an InvalidOperationException during a distributed transaction.

    Connections through device cradles

    Only TCP/IP connections to an instance of SQL Server are supported.

    Encrypted connections

    Encrypted connections to an instance of SQL Server are not supported.

  • The following SqlConnection.ConnectionString properties are not supported.

    attachdbfilename

    max pool size

    connection lifetime

    min pool size

    connection reset

    network library

    encrypt

    pooling

    enlist

     

  • ANSI data is supported only for SQL_Latin1_General_CP1_CI_AS collations from an English device. All strings in the .NET Framework are Unicode. System.Data.SqlClient converts ANSI data in SQL Server to Unicode using the .NET Framework Encoding classes. Although the Encoding classes are supported in the .NET Compact Framework, not all code pages are.

    Also, System.Data.SqlClient cannot read from or write to an ANSI column if the code page for the column is not available on the Windows CE .NET-based device. System.Data.SqlClient generates an error when the code page for an ANSI-to-Unicode conversion is not available. For information about code pages that are available to a specific Windows CE .NET-based device, contact the device manufacturer.

  • Windows Authentication is supported; however, the user ID and password used for authentication within the domain controller must always be specified in the connection string.

  • Applications using System.Data.SqlClient on Microsoft Windows CE-based devices can use the Windows NT LAN Manager (NTLM) authentication protocol, instead of using SQL Server authentication. To do this, the connection string must include the following properties:

    Integrated Security=SSPI; User ID=DOMAIN\username; Password=********;

  • System.Data.SqlClient cannot automatically discover the port number of a named instance or a SQL Server running on a custom port. To connect to a server running on a custom port, the port number must be specified in the connection string after the comma; for example:

    Data Source=myServer\myInstance,3860, UserID=test; ...

See Also

Concepts

SQL Server Compact Edition with the .NET Compact Framework

Other Resources

Data Access and XML Support