求推荐 wpf C/S架构访问Access数据库的框架 要做的系统采用C/S框架,数据库只能采用Access。访问Access采用oledb的形式,使用Entity framework必须要使用一个开源的provider,但是这个provider坑比较多,担心快速开发过程中遇到未知风险,不敢采用。求各位大佬推荐能访问Access数据库的轻量级框架。资金有限,只要免费的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 微软在大概15年前淘汰了 Jet 引擎,用 SQL Server Compact Edition 取代了它。仅仅在 Access 中还使用 Jet 而已。学习桌面嵌入式数据库开发,可以从这里下载安装包:https://archive.codeplex.com/?p=sqlcetoolbox 就用ado.net吧,资金有限,技术有限。 别用access了,轻量级数据库建议用sqlite3,数据库无需安装,sqilte DLL等支持文件+DB文件拷过去就能用了,你还能用sqilte的EF驱动,还能用linq访问sqlite,具体使用百度c# sqilite ef一大堆,例如http://www.cnblogs.com/Gyoung/p/4023275.html支持DBFirst或CodeFirst先安装sqlite3 for visual stdio 2015,然后nuget搜索装system.data.sqlite,顺带会装system.data.sqlite.core,system.data.sqlite.ef,system.data.sqlite.linq,app.config里改成 <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, 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" /> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> </entityFramework> <connectionStrings> </connectionStrings> <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> EF linq 访问:using (LocalEntities localEntity = new LocalEntities()){ var q = from d in localEntity.XXXXX orderby d.FlowNo descending group d by d.InterAddress into g select new { interAddress = g.Key, planQtySum = g.Sum(p => p.PlanQty), qtySum = g.Sum(p => p.Qty), isPacked = g.Max(p => p.IsPacked), state = g.Max(p => p.State), flowNo = g.Max(p => p.FlowNo), isUpdated = g.Max(p => p.IsUpdated) };}直接SQL访问: lock (writeDatabaseLock_Local) {using (LocalEntities localEntity = new LocalEntities()){ var t = localEntity.Database.BeginTransaction(); try { localEntity.Database.ExecuteSqlCommand( "UPDATE DownloadSortingData set XXX=? " + "where YYY=?", A,B; localEntity.Database.ExecuteSqlCommand("insert into ZZZ" + "(字段1,字段2...) " + "values " + "(?,?...) ", AA,BB...);... t.Commit(); } catch { t.Rollback(); throw; } }} System.String[*]这是个什么类型? 哪有系统分析师技术指南? 对于IComparable和ICompare一些疑问。 正则表达式(c#) 高分请教,在工作组模式下是否不能使用MS公共消息队列通讯?有其他解决方案吗? C#里接收Request.Form("xxx")应该使用什么数据类型? C#怎么开发玩转手机那样的软件 自定义异常 c# cookie 跨域删除问题 微软有免费教学录像下载! 接口定义问题。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 麻烦各位师兄帮我翻一下这段c#代码是什么意思
具体使用百度c# sqilite ef一大堆,例如
http://www.cnblogs.com/Gyoung/p/4023275.html支持DBFirst或CodeFirst先安装sqlite3 for visual stdio 2015,然后nuget搜索装system.data.sqlite,顺带会装system.data.sqlite.core,system.data.sqlite.ef,system.data.sqlite.linq,
app.config里改成 <entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, 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" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
</connectionStrings>
<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>
{
var q = from d in localEntity.XXXXX
orderby d.FlowNo descending
group d by d.InterAddress into g
select new
{
interAddress = g.Key,
planQtySum = g.Sum(p => p.PlanQty),
qtySum = g.Sum(p => p.Qty),
isPacked = g.Max(p => p.IsPacked),
state = g.Max(p => p.State),
flowNo = g.Max(p => p.FlowNo),
isUpdated = g.Max(p => p.IsUpdated)
};
}
直接SQL访问: lock (writeDatabaseLock_Local)
{
using (LocalEntities localEntity = new LocalEntities())
{
var t = localEntity.Database.BeginTransaction();
try
{
localEntity.Database.ExecuteSqlCommand(
"UPDATE DownloadSortingData set XXX=? "
+ "where YYY=?",
A,B; localEntity.Database.ExecuteSqlCommand("insert into ZZZ"
+ "(字段1,字段2...) "
+ "values "
+ "(?,?...) ",
AA,BB...);...
t.Commit();
}
catch
{
t.Rollback(); throw;
}
}
}