title: Can't insert the record to database C# SQLite
body: <p>I've been struggling with an error related to the database. Basically I have an SQLite db and I want to insert the data, but after I execute the method, no data is written to the db but no errors are shown either. This is my code:
  The db connection class:</p>
  <pre><code>class SqlDb
      {
          public static SQLiteConnection SqLiteConnection;
          public static string DATABASE_WAREHOUSE = &quot;DaneDB.db&quot;;
  
          public static string DATABASE_LACZKA =
              $&quot;Data Source= {DATABASE_WAREHOUSE};Version=3;New=False;Compress=True;&quot;;
  
          public SQLiteConnection Connect()
          {
              try
              {
                  SqLiteConnection = new SQLiteConnection(DATABASE_LACZKA);
                  SqLiteConnection.Open();
  
              }
              catch (Exception e)
              {
                  MessageBox.Show($&quot;Could not connect to the database {e}&quot;);
                  throw;
              }
  
              return SqLiteConnection;
          }
  
          public void Disconnect()
          {
              SqLiteConnection.Close();
          }
  
      }
  </code></pre>
  <p>and the inserting method</p>
  <pre><code>private void LoadToDb_Click(object sender, EventArgs e)
          {
              Data modelData = new Data();
              SqlDb db = new SqlDb();
              SQLiteConnection sqLiteConnection = db.Connect();
              SQLiteCommand sqLiteCommand = sqLiteConnection.CreateCommand();
  
  
              try
              {
                  modelData.Name = firstName.Text;
                  modelData.Age = Convert.ToInt32(DisplayAge.Text);
                  modelData.LastName = LastName.Text;
  
                  sqLiteCommand.CommandText =
                      $&quot;insert into DANE values('{modelData.Name}', '{modelData.LastName}', '{modelData.Age}')&quot;; 
  
                      db.Disconnect();
  
              }
              catch (Exception exception)
              {
                  MessageBox.Show(exception.Message);
              }
          }
  </code></pre>
  <p>I also have the options of database set to:</p>
  <pre><code>Build Action: Content
  Copy to output directory: Copy always
  </code></pre>