Enhance the command-line completion extension to return the names of
[sqlite.git] / vsixtest / MainPage.xaml.cpp
blobe67dcb83b23dc363124addc4d5c9e91d54e2f769
1 //
2 // MainPage.xaml.cpp
3 // Implementation of the MainPage class.
4 //
6 #include "pch.h"
7 #include "MainPage.xaml.h"
8 #include "sqlite3.h"
10 using namespace vsixtest;
12 using namespace Platform;
13 using namespace Windows::Foundation;
14 using namespace Windows::Foundation::Collections;
15 using namespace Windows::UI::Xaml;
16 using namespace Windows::UI::Xaml::Controls;
17 using namespace Windows::UI::Xaml::Controls::Primitives;
18 using namespace Windows::UI::Xaml::Data;
19 using namespace Windows::UI::Xaml::Input;
20 using namespace Windows::UI::Xaml::Media;
21 using namespace Windows::UI::Xaml::Navigation;
23 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
25 MainPage::MainPage()
27 InitializeComponent();
28 UseSQLite();
31 void MainPage::UseSQLite(void)
33 int rc = SQLITE_OK;
34 sqlite3 *pDb = nullptr;
36 rc = sqlite3_open_v2("test.db", &pDb,
37 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr);
39 if (rc != SQLITE_OK)
40 throw ref new FailureException("Failed to open database.");
42 rc = sqlite3_exec(pDb, "VACUUM;", nullptr, nullptr, nullptr);
44 if (rc != SQLITE_OK)
45 throw ref new FailureException("Failed to vacuum database.");
47 rc = sqlite3_close(pDb);
49 if (rc != SQLITE_OK)
50 throw ref new FailureException("Failed to close database.");
52 pDb = nullptr;