Skip to main content

Demo of ADO.NET POCO with SQLite database

This demonstration shows how to prepare for and how to implement model-first ADO.NET POCO objects with a SQLite backing store.

C# (46.5 KB)
 
 
 
 
 
5 Star
(1)
3,382 times
Add to favorites
9/12/2011
E-mail Twitter del.icio.us Digg Facebook
-- --------------------------------------------------
-- Date Created: 03/31/2011 21:00:35
-- compatible SQLite
-- Generated from EDMX file: C:\Users\Menno\documents\visual studio 2010\Projects\POCOWithSQLiteDemo\POCOWithSQLiteDemo\Model\DataModel.edmx
-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

    
	DROP TABLE if exists [Blogs];
    
	DROP TABLE if exists [Posts];
    
	DROP TABLE if exists [Posts_Review];

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'Blogs'
CREATE TABLE [Blogs] (
    [Id] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [Name] nvarchar(2147483647)   NOT NULL 
);

-- Creating table 'Posts'
CREATE TABLE [Posts] (
    [Id] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [Author] nvarchar(2147483647)   NOT NULL ,
    [Date] datetime   NOT NULL ,
    [Content] nvarchar(2147483647)   NOT NULL ,
    [Blogs_Id] integer   NOT NULL 
			
		,CONSTRAINT [FK_PostBlog]
    		FOREIGN KEY ([Blogs_Id])
    		REFERENCES [Blogs] ([Id])					
    		
			);

-- Creating table 'Posts_Review'
CREATE TABLE [Posts_Review] (
    [Rating] nvarchar(2147483647)   NOT NULL ,
    [Id] integer   NOT NULL 
			
		,CONSTRAINT [FK_Review_inherits_Post]
    		FOREIGN KEY ([Id])
    		REFERENCES [Posts] ([Id])					
    		
			);


-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------