Mobile CoDe.NET: Exploring the .NET Compact Framework : Page 9
"Windows CE or Mobile Web?" The .NET world can steer you in two very opposite directions: .NET Compact Framework or ASP.NET Mobile Controls.
by Nickolas Landry
Oct 6, 2003
Page 9 of 10
Mobile Data Access
Data access to and from mobile devices is a pretty big topic that will eventually warrant an article of its own. I nonetheless want to give you the basics. The good news is ADO.NET is very well supported in .NETcf, including DataSets, DataViews, and other much-loved classes. You can connect to two types of databases natively since .NETcf provides you with ADO.NET data providers for:
SQL Server 2000 (System.Data.SqlClient)
SQL Server 2000 for Windows CE, also known as SQL CE (System.Data.SqlServerCe)
The following list highlights the main differences in ADO.NET support in .NETcf:
No connection pooling.
No distributed transactions.
No encrypted connections to SQL Server.
Some classes are missing, such as the SqlClientPermission class and the SqlClientPermission attribute located in the System.Data.SqlClient namespace.
Windows authentication requires the presence of the username and password data in the connection string since Windows NT security isn't fully supported in Windows CE.
No System.Data.OleDb namespace.
As for data binding in Windows Forms, classes inheriting from the Control class support simple data property binding. On the other hand, classes that inherit from ListControl, (i.e. ListBox, ComboBox) can bind to objects that expose IList or IListSource (ArrayList). Another limitation is that you cannot use casting in data binding. As for our friend the DataGrid, while it does support data binding even though it is read-only, it can only bind to a single table unlike the desktop DataGrid that can bind to many tables. This means the DataSource property must be set to a DataTable object, and not a DataSet.
Ever since Windows developers started using COM, versioning has become synonymous with nightmare. Fortunately, .NET solves most of the versioning issues, namely by getting rid of "DLL Hell." This remains true in the .NET Compact Framework which does support explicit binding by default. The end result is that a .NETcf application will always load the exact version of a shared library that was referenced at compile-time. The Microsoft motto here is "Never break a functioning app!" (It's about time...)