How can a SQL Server CE database be simultaneously connectable and un-?

那年仲夏 提交于 2019-12-02 11:37:39

Well first I'll say that I have never, ever, ever used the "Add Connection" stuff to try to connect directly to a database on the device. May pas dozen-plus years of developing for Windows CE have taught me that just about anything that requires interaction between the PC and the device outside of the debugger itself is fraught with peril. ActiveSync == "There be Monsters Here" on the map.

So am I surprised this doesn't work? Not at all. I'm actually more surprised it's even an option on the dialog. It's possible that maybe the device version of SQL CE and the PC version differ, and it's that difference that's making it so the desktop can't read the remove file properly. Or maybe it's just a buggy connection (again, see "ActiveSync").

So how do you move forward? Easy. Copy the database from the device to the PC, then open up the PC copy with Studio. Seriously. That's exactly how I do it, and it works just fine.

I think I've already recommended this to you before, but it's worth repeating. Avoid DataTables. They are gigantic memory hogs, and under CE you can't afford a memory hog. Basically it duplicates the entire source table into RAM for you. SqlCeDataReader and SqlCeResultSet are your friends.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!