ورود

View Full Version : خطا در هنگام اتصال به sqlit.net-pcl



kolibri
شنبه 14 آذر 1394, 18:45 عصر
سلام؛
می خوام به دیتابیسم کانکت بشم ولی ارور میگیرم:
این جزییات کامل خطاست:

System.DllNotFoundException was unhandled by user code
HResult=-2146233052
Message=Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=SQLite.Net.Platform.WinRT
TypeName=""
StackTrace:
at SQLite.Net.Platform.WinRT.SQLite3.SetDirectory(UIn t32 directoryType, String directoryPath)
at SQLite.Net.Platform.WinRT.SQLiteApiWinRT..ctor()
at SQLite.Net.Platform.WinRT.SQLitePlatformWinRT..cto r()
at Do_.Create.savedata()
at Do_.Create.btnAdd_Tapped(Object sender, TappedRoutedEventArgs e)
InnerException:

این هم کد من:

private void savedata()
{
var path = Path.Combine(Windows.Storage.ApplicationData.Curre nt.LocalFolder.Path, "db.sqlite");


using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), path))
{
conn.CreateTable<Creatdb>();
}



خطا از ازن قسمت است:
using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), path))

En_MK
چهارشنبه 25 آذر 1394, 08:56 صبح
سلام
من سرچ کردم راه حلی که پیدا کردم (http://stackoverflow.com/questions/27328490/why-am-i-getting-unable-to-load-dll-sqlite3-in-my-wpf-app/31432555#31432555)اینه که روی پروژه راست کلیک کنید و properties بگیرید از قسمت build:platform target را یا x86 یا x64 انتخاب کنید
buildکنید و runکنید