title: .Net EntityFramework Core - SQLite Error 1: no such table
body: <p>I am running into an issue where the code is unable to find my existing Sqlite database that is in the same folder as this code that is calling it.  The error I am getting is, "SQLite Error 1 table does not exist." I know the table exists, it is just unable to find the path.  What am I doing wrong?  </p>
  
  <p><em>Note: I am not creating a code first Sqlite database. This is opening an existing Sqlite database</em></p>
  
  <p><strong>DATABASE CONTEXT CODE</strong></p>
  
  <pre><code>using Microsoft.Data.Sqlite;
  using Microsoft.EntityFrameworkCore;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace MyWidget.Domain.Data
  {
      public static class MyWidgetService
      {
          public static void GetAll()
          {            
  
              using var context = new MyWidgetContext();
              if (context.Translations.Any())
              {
                  var data = context.Widgets.ToList(); 
                  foreach (var widget in data)
                  {
                      Console.WriteLine(widget.ProductName);
                  }
              }
              else
              {
                  Console.WriteLine("No widgets found");
              }
          }
      }
  }
  </code></pre>
  
  <p>**DATABASE SERVICE CODE</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  using System.Text;
  using Microsoft.EntityFrameworkCore;
  
  namespace MyWidget.Domain.Data
  {
      public class MyWidgetContext : DbContext
      {
          protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
          {
              optionsBuilder.UseSqlite(connectionString: "Filename=./MyWidgetDB.db");
          }
  
          public DbSet&lt;WidgetData&gt; Widgets { get; set; }
      }
  
      public class WidgetData
      {
          public int Id { get; set; }
          public string ProductName { get; set; }
  
      }
  }
  </code></pre>