我正在尝试创建一个简单的项目来探索实体框架6代码如何首先与sqlite数据库提供程序一起工作,但当我完成我的应用程序时,我得到错误:
"实体框架提供程序类型'System.Data.SQLite.SQLiteProviderServices,System.Data.SQLite.Linq,Version = 1.0.91.0,Culture = neutral,PublicKeyToken = db937bc2d44ff139'在ADO.NET提供程序的应用程序配置文件中注册无法加载不变名称'System.Data.SQLite'.请确保使用程序集限定名称并且程序集可供正在运行的应用程序使用.请参阅 http://go.microsoft.com/fwlink/?LinkId = 260882了解更多信息."
我认为这个错误与app.config文件有关.有没有人为Entity framework 6 + Sqlite 1.0.91提供有效的app.config文件?
这些是我的配置文件内容:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.SQLiteProviderServices, System.Data.SQLite.Linq, Version=1.0.91.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>
</providers>
</entityFramework>
<connectionStrings>
<add name="BloggingContext" connectionString="Data Source=.\animals.sqlite" providerName="System.Data.SQLite"/>
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite"/>
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description="Data Provider for …Run Code Online (Sandbox Code Playgroud) 在NSString的 Apple文档中有一个stringByReplacingCharactersInRange方法,但是我在Monotouch中找不到这个方法.
Monotouch是否缺少此方法实现 - 本机API绑定?
我需要这个方法在shouldChangeCharactersInRange中实现一些自定义字符串处理逻辑
在UITextView有一个Changed事件来处理按键.然而UITextField事实并非如此.
如何在中检测到KeyPress事件UITextField?
有描述的方法在这里使用的通知,但我的问题是,我不能从TextFieldTextDidChangeNotification退订.
有时我想确保在从另一个函数返回之前执行了某个函数调用,或者一个整数被递减。
例如考虑这个代码:
void doSomething()
{
try
{
.....
.....
return;
.....
.....
.....
return;
......
} catch ( ... )
}
myvariable--;
}
Run Code Online (Sandbox Code Playgroud)
我想确保 myvariable 总是递减,无论是否有异常或返回调用。在 C++ 中是否有任何内置对象,或者我应该创建自己的类来接受 std::function 并在对象超出对象析构函数的范围时执行它?
例如,在 C# 中有 try..catch...finally 块,在 finally 块中,您可以在从函数返回之前放置您想要执行的任何代码。
考虑这个表(来自http://www.tizag.com/mysqlTutorial/mysqlmax.php):
Id name type price
123451 Park's Great Hits Music 19.99
123452 Silly Puddy Toy 3.99
123453 Playstation Toy 89.95
123454 Men's T-Shirt Clothing 32.50
123455 Blouse Clothing 34.97
123456 Electronica 2002 Music 3.99
123457 Country Tunes Music 21.55
123458 Watermelon Food 8.73
Run Code Online (Sandbox Code Playgroud)
此SQL查询返回每种类型中最昂贵的项:SELECT类型,MAX(价格)FROM产品GROUP BY类型
Clothing $34.97
Food $8.73
Music $21.55
Toy $89.95
Run Code Online (Sandbox Code Playgroud)
我还希望为每一行获取属于上述最高价格的字段ID和名称.什么SQL查询将返回这样的表?
Id name type price
123455 Blouse Clothing 34.97
123458 Watermelon Food 8.73
123457 Country Tunes Music 21.55
123453 Playstation Toy …Run Code Online (Sandbox Code Playgroud) 在UIView子类中,我重写Draw子画面来绘制一些自定义文本,但是文本总是被绘制为翻转文本.
这是我正在使用的代码:
class TextViewProblem : UIView
{
public override void Draw (RectangleF rect)
{
base.Draw (rect);
CGContext g = UIGraphics.GetCurrentContext();
UIColor.White.SetFill();
g.SelectFont("Arial",16f,CGTextEncoding.MacRoman);
UIColor.White.SetFill();
g.SetTextDrawingMode(CGTextDrawingMode.Fill);
g.ShowTextAtPoint(1,25,"Yiannis 123");
}
}
Run Code Online (Sandbox Code Playgroud)
这是此代码的输出:

为什么要翻转文字?
我正在运行:MonoDevelop 2.4.2 iPhone模拟器4.2 MonoTouch 3.2.6
您可以从以下链接下载项目以重现此问题:www.grbytes.com/downloads/TextProblem.zip
我试图使用CreateFile从MBR中读取一些数据,但是如果没有管理员权限我无法使用它.
我使用的代码是这样的:
hDevice = CreateFile("\\.\PhysicalDrive0", GENERIC_READ, FILE_SHARE_READ Or FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0)
Run Code Online (Sandbox Code Playgroud)
是否可以在没有管理员权限的情况下从MBR读取数据?
xamarin.ios ×3
ios ×2
c# ×1
c++ ×1
c++11 ×1
firebird ×1
firebird2.1 ×1
ios4 ×1
keypress ×1
max ×1
monodevelop ×1
nsstring ×1
sql ×1
sqlite ×1
uitextfield ×1
vb.net ×1
winapi ×1