Connecting to a SQL Server Compact Edition (.sdf) from an MFC application
Posted
by Hazerd
on Stack Overflow
See other posts from Stack Overflow
or by Hazerd
Published on 2010-05-03T20:09:44Z
Indexed on
2010/05/23
3:10 UTC
Read the original article
Hit count: 469
Hey !
I'm building an MFC app in Visual Studio 2008 which classifies textures and I need some sort of lightweight database to hold the characteristics (just some doubles and strings) which can be:
-carried around with the app on different computers;
-be able to perform queries on it from the app (searches , updates ,inserts ,etc);
Currently I'm looking into SQL compact edition because it was very easy to create from Visual Studio ( I also need only one table) but I having a hard time connecting and updating the db from C++. This is what I've found on msdn regarding C++ and SQLCE:
public:
void createSqlCeConnection(){
SqlCeConnection* myConnection = new SqlCeConnection();
myConnection->ConnectionString = "DataSource = blabla.sdf";
MessageBox::Show(String::Format( S"Connection State: {0}", __box(myConnection->State)));
}
Unfortunately my experience with .net apps is pretty limited.
Hopefully you bright minds could tell me if I'm on the right path and what links and includes should I add for this to work with an C++ MFC projects.
Thanks !
© Stack Overflow or respective owner