首页 技术 正文
技术 2022年11月18日
0 收藏 461 点赞 4,118 浏览 2227 个字

在 vs 2013 上用

1.NuGet程序包来获取,它也会自动下载EF6的包 :system.Data.sqlite 他会自动下载 其它几个需要的包.

2.在Sqlite官网上下载对应的版本:http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

3.vs2013 中 的ADO.net 不支持 sqlite的视图要自己安装一个包 Entity Framework 6 Tools for Visual Studio 2012 & 2013.

4.下面就可以按照流程生成相关的程序 数据中的 ADO.net 实体数据模型.

5.生成后在 app.config 的 system.data段 增加一个:”System.Data.SQLite的说明

<?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>

<entityFramework>
<providers>
<provider invariantName=”System.Data.SQLite” type=”System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6″ />
<provider invariantName=”System.Data.SQLite.EF6″ type=”System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6″ />
</providers>
<defaultConnectionFactory type=”System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework”>
<parameters>
<parameter value=”v11.0″ />
</parameters>
</defaultConnectionFactory>
</entityFramework>

<system.data>
<DbProviderFactories>
<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, Version=1.0.99.0, Culture=neutral” />
<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″ />
</DbProviderFactories>
</system.data>

<connectionStrings>
<add name=”ShowMachineEntities” connectionString=”metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SQLite.EF6;provider connection string=&quot;data source=E:\项目\EF6连sqlit例子\DB\ShowMachine.db&quot;” providerName=”System.Data.EntityClient” />
</connectionStrings>
</configuration>

6.这样就可以在 vs 2013中使用 sqlite了.

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,022
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,513
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,359
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,142
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,773
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,851