Click here to Skip to main content
15,887,376 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: MESSAGE: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine Pin
byka3-Feb-16 4:16
byka3-Feb-16 4:16 
GeneralRe: MESSAGE: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine Pin
Richard MacCutchan3-Feb-16 4:44
mveRichard MacCutchan3-Feb-16 4:44 
AnswerRe: MESSAGE: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine Pin
Triche Astuce11-Feb-16 5:48
Triche Astuce11-Feb-16 5:48 
QuestionHow To lock date function in .Net Pin
Elangovan V1-Feb-16 0:53
Elangovan V1-Feb-16 0:53 
AnswerRe: How To lock date function in .Net Pin
Dave Kreskowiak1-Feb-16 2:30
mveDave Kreskowiak1-Feb-16 2:30 
AnswerRe: How To lock date function in .Net Pin
Pete O'Hanlon1-Feb-16 5:04
mvePete O'Hanlon1-Feb-16 5:04 
AnswerRe: How To lock date function in .Net Pin
Gerry Schmitz1-Feb-16 6:14
mveGerry Schmitz1-Feb-16 6:14 
QuestionProblem with sqlite and entity framework. please help! Pin
neodeaths30-Jan-16 19:28
neodeaths30-Jan-16 19:28 
i am trying to get an sqlite project c# wpf application working with entity framework so that when i start my application and the sqlite file is missing it would create it. and the schema would come from the context just like entity framework codefirst

this is what i got so far:
my app.config
XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite.EF6" />
      <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
      
      <remove invariant="System.Data.SQLite" />
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />

    </DbProviderFactories>
  </system.data>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
      
      <!---->
      <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
      <!---->
    </providers>
  </entityFramework>
</configuration>


the following is my code for the entity and context. and how i initiate them:(i got them from reading tutorials)
C#
class ChinookContext : DbContext
    {
        public DbSet Artists { get; set; }
        public DbSet Albums { get; set; }
        public ChinookContext(string filename)
            : base(new SQLiteConnection()
            {
                ConnectionString =
                    new SQLiteConnectionStringBuilder() { DataSource = filename, ForeignKeys = true }
                    .ConnectionString
            }, true)
        {
        }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            // Chinook Database does not pluralize table names
            modelBuilder.Conventions
                .Remove();
        }

   
    }
    public class Artist
    {
        public Artist()
        {
            Albums = new List();
        }

        public long ArtistId { get; set; }
        public string Name { get; set; }

        public virtual ICollection Albums { get; set; }
    }

    public class Album
    {
        public long AlbumId { get; set; }
        public string Title { get; set; }

        public long ArtistId { get; set; }
        public virtual Artist Artist { get; set; }
    }


the problem with this code is that it keep having the error:
{"SQL logic error or missing database\r\nno such table: Artist"}
and the sqlite file is not being created as well.

does anyone know why and be so kind as to show me how to resolve this?
AnswerRe: Problem with sqlite and entity framework. please help! Pin
Sascha Lefèvre30-Jan-16 20:59
professionalSascha Lefèvre30-Jan-16 20:59 
AnswerRe: Problem with sqlite and entity framework. please help! Pin
Dave Kreskowiak31-Jan-16 3:41
mveDave Kreskowiak31-Jan-16 3:41 
Questiondesktop app using java prodramming language Pin
Member 1229118627-Jan-16 7:30
Member 1229118627-Jan-16 7:30 
AnswerRe: desktop app using java prodramming language Pin
Pete O'Hanlon27-Jan-16 7:45
mvePete O'Hanlon27-Jan-16 7:45 
Question[C# 2008] TcpClient Close method does not close TCP connection Pin
steve_949661324-Jan-16 23:44
professionalsteve_949661324-Jan-16 23:44 
AnswerRe: [C# 2008] TcpClient Close method does not close TCP connection Pin
Richard MacCutchan24-Jan-16 23:58
mveRichard MacCutchan24-Jan-16 23:58 
GeneralRe: [C# 2008] TcpClient Close method does not close TCP connection Pin
steve_949661325-Jan-16 1:56
professionalsteve_949661325-Jan-16 1:56 
GeneralRe: [C# 2008] TcpClient Close method does not close TCP connection Pin
Richard MacCutchan25-Jan-16 2:33
mveRichard MacCutchan25-Jan-16 2:33 
GeneralRe: [C# 2008] TcpClient Close method does not close TCP connection Pin
steve_949661325-Jan-16 2:59
professionalsteve_949661325-Jan-16 2:59 
QuestionLimiting GOOGLE CHROME APPLICATION? Pin
Member 1227913922-Jan-16 5:46
Member 1227913922-Jan-16 5:46 
AnswerRe: Limiting GOOGLE CHROME APPLICATION? Pin
Richard MacCutchan22-Jan-16 6:33
mveRichard MacCutchan22-Jan-16 6:33 
AnswerRe: Limiting GOOGLE CHROME APPLICATION? Pin
Eddy Vluggen22-Jan-16 6:34
professionalEddy Vluggen22-Jan-16 6:34 
QuestionRe: Limiting GOOGLE CHROME APPLICATION? Pin
Paul Conrad23-Jan-16 11:56
professionalPaul Conrad23-Jan-16 11:56 
AnswerRe: Limiting GOOGLE CHROME APPLICATION? Pin
Member 1227913924-Jan-16 13:32
Member 1227913924-Jan-16 13:32 
QuestionBandwidth limit for application google chrome. Pin
Member 1227913921-Jan-16 8:05
Member 1227913921-Jan-16 8:05 
AnswerRe: Bandwidth limit for application google chrome. Pin
Gerry Schmitz21-Jan-16 8:22
mveGerry Schmitz21-Jan-16 8:22 
AnswerRe: Bandwidth limit for application google chrome. Pin
Dave Kreskowiak21-Jan-16 11:29
mveDave Kreskowiak21-Jan-16 11:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.