This post originated from an RSS feed registered with .NET Buzz
by Doug Thews.
Original Post: Can't Use CF.NET libs in WinForms App
Feed Title: IlluminatiLand
Feed URL: http://apps5.oingo.com/apps/domainpark/domainpark.cgi?client=netw8744&s=JETBRAINS.COM
Feed Description: A technology blog for people enlightened enough to think for themselves
Well, I've experimented with trying to be able to use the SQL CE libraries from the CF.NET framework inside a WinForms application - but with no luck.
Since the SQL CE libraries are inside the System.Data namespace (same named DLL) in the CF.NET framework, it requires you to remove the System.Data reference from your WinForms app. But, when you try to manually add a reference to the new System.Data.DLL, VS.NET tells you that in doing this, all references to System.Drawing and System.Xml will also be changed to the CF.NET directory. Changing System.Drawing to CF.NET pretty much sinks hope of using the SqlCeReplication class in a WinForms application. As a proving ground, I could have lived with the CF.NET subset of System.Data, but changing System.Drawing won't pretty much eliminate the possibility of building a WinForms app.
Your best bet is to generate your own class that mimics the properties & methods of SqlCeReplication, but use the SQL Server standard stored procedure calls for managing replication within the new class.