Skip to content

"The given key was not present in the dictionary" #334

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Add a Foreign Key to a SQLite database
2. DbMetal /provider:Sqlite /conn "Data Source=bms4.db3" /dbml:Model.dbml

I am getting this error:
>>> Reading schema from SQLite database
DbMetal: The given key was not present in the dictionary.

What version of the product are you using? 0.20.1
On what operating system? Windows XP

This is my SQLite database

CREATE TABLE [Categories] (
  [ParentId] INT, 
  [Name] VARCHAR(100));


CREATE TABLE [Fees] (
  [CategoryId] INT, 
  [Name] VARCHAR(100), 
  [Value] VARCHAR(50), 
  [Info] VARCHAR(200));


CREATE TABLE [Markups] (
  [CategoryId] INT, 
  [UpTo] MONEY, 
  [Value] VARCHAR(50), 
  [Info] VARCHAR(200));

That will create the .dbml file successfully.
But once you add a Foreign Key to [Fees], DBLinq will fail
(I have made the FK name lowercase as suggested by others)

CREATE TABLE [Fees] (
  [CategoryId] INT CONSTRAINT [fk_fees_categories] REFERENCES [Categories]([rowid]), 
  [Name] VARCHAR(100), 
  [Value] VARCHAR(50), 
  [Info] VARCHAR(200));

Could someone help me please?

Original issue reported on code.google.com by hardi...@gmail.com on 8 Nov 2012 at 6:34

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions