public void FromItemList(string pDBPath, Sven_Bobrowski.DE.Integration.Items pItems) { if (null == pItems) return; try { // connect and create tables using (SQLiteConnection tConnection = new SQLiteConnection(String.Format("Data Source={0};Version=3;", pDBPath))) { tConnection.Open(); // loop items foreach (int tId in pItems.DataItems.Keys) { Sven_Bobrowski.DE.Integration.DataItem tItem; if (pItems.TryGetItem(tId, out tItem)) { // check if dataset allready exists, so update it, else add it if (DataItemExists(tConnection, tId)) { UpdateDataItem(tConnection, tItem); } else { InsertDataItem(tConnection, tItem); } } } tConnection.Close(); } } catch (Exception e) { string tMsg = String.Format(Resources.DB_Update_Failed_1 + Environment.NewLine + Resources.DB_Update_Failed_2, pDBPath, e.Message); MessageBox.Show(tMsg, Resources.DB_Update_Failed_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }