这里的东西看起来很容易但是让我疯狂,因为天......
我正在尝试使用Entity Framework和Sql Server Compact创建一个应用程序.我想使用模型第一种方法.我为模型创建了一个edmx文件并运行了Database Generation向导,该向导生成了一个包含Table Creation命令的edmx.sqlce文件.但是在哪里运行这个edmx.sqlce文件?
我试图通过将内容发送到SqlCommand的ExecuteNonQuery命令来运行该文件.但它也会出现语法错误 - 但为什么生成的edmx.sqlce文件会被破坏?我想我必须在其他地方运行该文件.谁能告诉我在哪里?(我只有一个C#express版本).
edmx.sqlce文件的内容是:
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server Compact Edition
-- --------------------------------------------------
-- Date Created: 07/27/2011 23:50:28
-- Generated from EDMX file: C:\Users\Ralf\Programmierung\MySoftware\MySoftware\MySoftwareDatenbank\MySoftwareDataModel.edmx
-- --------------------------------------------------
-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- NOTE: if the constraint does not exist, an ignorable error will be reported.
-- --------------------------------------------------
-- --------------------------------------------------
-- Dropping existing tables
-- NOTE: if the table does not exist, an ignorable error will …Run Code Online (Sandbox Code Playgroud)