Speeding up database access

Table Indexes Give tables Indexes if they will help with SELECT queries, e.g. Group Transactions SQLite is capable of carrying out many thousands of actions on a database per second, but not very many individually triggered transactions. You can work round this by grouping transactions such as INSERT or UPDATE to get a massive speed […]

Read More

Using a newer SQLite version

You’ll need to update the .Net Version your project is uses or you’lll get a compile error such as: ‘SQLite’: is not a member of ‘System::Data’ See here

Read More

Changing A Projects .Net Version

The following is based on the guide from https://docs.microsoft.com/en-us/cpp/build/how-to-modify-the-target-framework-and-platform-toolset?view=vs-2019 In Solution Explorer, select your project. Menu > Project > Unload project (only shown when you have the pruoject selected) This unloads the project (.vcxproj) file for your project. Menu > File > Open > File > In the Open File dialog box, navigate to your […]

Read More

Making Visual C++ work the way we like

Menu > Tools > Options Text Editor > C/C++ General > Automatic brace completion = Off Tabs > Keep tabs Code Style > Formatting > Indentation > Indent case labels = Off Install Extra Components Old and new project will likely need things not added by the isntaller as default. Go to Windows programs and […]

Read More

Our Visual Studio Preferences for C++

These are some of the things we do to make Visual Studio behave the way we like for C++ development: Options > Text Editor > C/C++ General > Automatic brace completion = Off Advanced > Brace completion > Complete multiline comments = Off Formatting > General > Automatically format when I paste = OFF (Stops […]

Read More

Styling Cells

NOTE If you have just set the datasource of a datatableview any styling you apply to cells may get ignored.  You need to set your styling in (or wait for) dataGridView1_DataBindingComplete() instead. Styling cells //******************************************************** //******************************************************** //********** DATAGRIDVIEW DATA BINDING COMPLETE ********** //******************************************************** //******************************************************** private: System::Void dataGridView1_DataBindingComplete(System::Object^ sender, System::Windows::Forms::DataGridViewBindingCompleteEventArgs^ e) { int RowIndex; try { //—————————————————— //—– […]

Read More

Styling Header Cells

Set header cell colour This needs EnableHeadersVisualStyles=false to work dataGridView1->Columns[0]->HeaderCell->Style->BackColor = System::Drawing::Color::Orange;  

Read More

Styling Columns

Make columns invisible dataGridView1->Columns[0]->Visible = false; Set column width dataGridView1->Columns[ColumnIndex]->Width = 100;    

Read More

DataTable as the data source

Example DataTable ^DataTable1 = gcnew DataTable(); //—– ADD COLUMNS —– DataTable1->Columns->Add("Column 1"); DataTable1->Columns->Add("Column 2"); //—– ADD ROWS —– DataRow ^DataRow1; DataRow1 = DataTable1->NewRow(); DataRow1[0] = "A"; DataRow1[1] = "B"; DataTable1->Rows->Add(DataRow1); DataRow1 = DataTable1->NewRow(); DataRow1[0] = "AA"; DataRow1[1] = "BB"; DataTable1->Rows->Add(DataRow1); DataRow1 = DataTable1->NewRow(); DataRow1[0] = "AAA"; DataRow1[1] = "BBB"; DataTable1->Rows->Add(DataRow1); array<String^> ^MyNewRowOfStrings = gcnew array<String^>(2); […]

Read More