sqlcedatareader

Why is this SqlCeCommand ExecuteReader call failing?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 06:40:45
问题 I adapted my code below from "Microsoft .NET Compact Framework" by Wigley and Wheelwright: SqlCeConnection cn = new SqlCeConnection(@"Data Source=\My Documents\Traffic.sdf"); String sSQL= "SELECT CarID, Reg, Location FROM Cars"); SqlCeCommand cmdSelect = new SqlCeCommand(sSQL, cn); cmdSelect.CommandType = CommandType.Text; SqlCeDataReader dtr = cmdSelect.ExecuteReader(CommandBehavior.Default); // It's "cmd." instead of "cmdSelect." in the book, but that doesn't compile while (dtr.Read()) {

DllGetClassObject return “No such interface supported” while CoCreateInstance can find it successful

别等时光非礼了梦想. 提交于 2019-12-11 20:07:11
问题 I want to use the library "sqlceoledb35.dll" to process .sdf db file without register. I know this dll is a COM dll and used in ADO. But I can't get the target interface, it returns error "No such interface supported". Here is the code: CoInitialize(nullptr); HMODULE hmod = CoLoadLibrary((L"sqlceoledb35.dll"), true); DllGetClassObject_t pDllGetClassObject =(DllGetClassObject_t)GetProcAddress(hmod, "DllGetClassObject"); HRESULT hr=NOERROR; IDBInitialize *pIDBInitialize1=NULL; IDBInitialize