title: Errors saving images to database
body: <p>I have a OpenFileDialog which will suppose to select photo and save it to database
  but the problem is when I access the class when the dialog result of the openFileDialog is OK
  it says that <code>no such table : PhotoFile</code> when the SavePhoto function is called with following arguments:</p>
  
  <p><strong>TODO(P J):put values here</strong></p>
  
  <p>This is what I've tried so far</p>
  
  <pre><code>OpenFileDialog d = new OpenFileDialog();
  
          d.Filter = ("JPEG Imange (*.jpg|*.jpg|PNG Image (*.png)|All Files*.*");
          if ((d.ShowDialog()) == DialogResult.OK)
          {
             SavePhoto(txtID.text,d.fileName);
          }
  </code></pre>
  
  <p>Here's the code for the function</p>
  
  <pre><code>        try {
          using (SQLite.SQLiteConnection SQLConnect = new SQLite.SQLiteConnection(g_constring)) {
              byte[] photo = FileImageToByte(PhotoFile);
              SQLConnect.Open();
              if (SQLConnect.State == ConnectionState.Open) {
                  SQLiteCommand SQLcommand = new SQLiteCommand(SQLConnect);
                  SQLcommand = SQLConnect.CreateCommand;
                  SQLcommand.CommandText = "DELETE FROM PhotoFile WHERE PhotoID = '" + PhotoId + "'";
                  SQLcommand.ExecuteNonQuery();
                  SQLcommand.Parameters.Clear();
  
                  SQLcommand.CommandText = "INSERT INTO PhotoFile(PhotoID, Photo) VALUES(@EmployeeID, @Photo1)";
  
                  SQLiteParameter SQLparmID = new SQLiteParameter("@EmployeeID", PhotoId);
                  SQLparmID.DbType = DbType.String;
                  SQLparmID.Value = PhotoId;
                  SQLcommand.Parameters.Add(SQLparmID);
  
                  SQLiteParameter SQLparm = new SQLiteParameter("@Photo1", photo);
                  SQLparm.DbType = DbType.Binary;
                  SQLparm.Value = photo;
                  SQLcommand.Parameters.Add(SQLparm);
  
                  SQLcommand.ExecuteNonQuery();
  
                  bReturn = true;
              } else {
                  bReturn = false;
              }
          }
      } catch (System.Exception eX) {
          MessageBox.Show(eX.Message.ToString(), "Error in database", MessageBoxButtons.OK, MessageBoxIcon.Error);
          bReturn = false;
      }
      return bReturn;
  }
  </code></pre>
  
  <p>PhotoFile table exist in my database in fact I've tried a Windows form and trigger the function if the <code>dialog result = ok</code> but when I used the <code>openFileDialog</code> it always produce the error as stated above.</p>