本文整理汇总了C#中IDbHandle类的典型用法代码示例。如果您正苦于以下问题:C# IDbHandle类的具体用法?C# IDbHandle怎么用?C# IDbHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDbHandle类属于命名空间,在下文中一共展示了IDbHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Open
public Result Open(string filename, out IDbHandle db)
{
Sqlite3.sqlite3 internalDbHandle = null;
var ret = (Result) Sqlite3.sqlite3_open(filename, ref internalDbHandle);
db = new DbHandle(internalDbHandle);
return ret;
}
示例2: ExtendedErrCode
public ExtendedResult ExtendedErrCode(IDbHandle db)
{
// not supported
return 0;
// var dbHandle = (DbHandle)db;
// return Sqlite3.sqlite3_extended_errcode(dbHandle.InternalDbHandle);
}
示例3: Open
public Result Open(byte[] filename, out IDbHandle db, int flags, IntPtr zvfs)
{
IntPtr dbPtr;
Result r = SQLiteApiWin32Internal.sqlite3_open_v2(filename, out dbPtr, flags, zvfs);
db = new DbHandle(dbPtr);
return r;
}
示例4: Open
public Result Open(byte[] filename, out IDbHandle db, int flags, IntPtr zVfs)
{
string dbFileName = Encoding.UTF8.GetString(filename, 0, filename.Length -1 );
Database internalDbHandle = null;
var ret = (Result)Sqlite3.sqlite3_open_v2(dbFileName, out internalDbHandle, flags, "");
db = new DbHandle(internalDbHandle);
return ret;
}
示例5: MainWindow
public MainWindow()
{
InitializeComponent();
SelectedLanguage = "PL";
CookingBookLanguageSelect.ChangeLanuage(SelectedLanguage, this);
DbClient = DbDependancyResolver.Resolve<IDbHandle, SQLIteClient>();
}
示例6: Prepare2
public IDbStatement Prepare2(IDbHandle db, string query)
{
var internalDbHandle = (DbHandle) db;
IntPtr stmt;
Result r = SQLiteApiWin32Internal.sqlite3_prepare_v2(internalDbHandle.DbPtr, query, query.Length, out stmt, IntPtr.Zero);
if (r != Result.OK)
{
throw SQLiteException.New(r, Errmsg16(internalDbHandle));
}
return new DbStatement(stmt);
}
示例7: Prepare2
public IDbStatement Prepare2(IDbHandle db, string query)
{
var dbHandle = (DbHandle) db;
var stmt = new Sqlite3.Vdbe();
int r = Sqlite3.sqlite3_prepare_v2(dbHandle.InternalDbHandle, query, -1, ref stmt, 0);
if (r != 0)
{
throw SQLiteException.New((Result) r, GetErrmsg(db));
}
return new DbStatement(stmt);
}
示例8: MigrationBase2Base
public MigrationBase2Base(IDbHandle dbCli)
{
InitializeComponent();
MainDB = dbCli;
MainColection = new CookingBookDataCollection(dbCli);
MainColection.GetAll();
MainDbListViev.ItemsSource = MainColection.ListOfRecipes;
CollectionView MainRecipeViev = (CollectionView)CollectionViewSource.GetDefaultView(MainDbListViev.ItemsSource);
MainRecipeViev.Filter = (item => (String.IsNullOrEmpty(MainRecipeFilterText.Text) ? true : ((item as Recipe).Name.IndexOf(MainRecipeFilterText.Text, StringComparison.OrdinalIgnoreCase) >= 0)));
}
示例9: BackupInit
public IDbBackupHandle BackupInit(IDbHandle destHandle, string destName, IDbHandle srcHandle, string srcName)
{
var internalDestDb = (DbHandle)destHandle;
var internalSrcDb = (DbHandle)srcHandle;
IntPtr p = SQLiteApiAndroidCipherInternal.sqlite3_backup_init (internalDestDb.DbPtr,
destName,
internalSrcDb.DbPtr,
srcName);
if (p == IntPtr.Zero) {
return null;
} else {
return new DbBackupHandle (p);
}
}
示例10: Open
public Result Open (byte[] filename, out IDbHandle db, int flags, IntPtr zvfs)
{
ActionsTaken.Add(string.Concat(filename.ToString(), "-Opened"));
db = new MockDbHandle ();
CreateStatementsExecuted = new List<string> ();
DeleteStatementsExecuted = new List<string> ();
InsertOrReplaceStatementsExecuted = new List<string> ();
InsertStatementsExecuted = new List<string> ();
UpdateStatementsExecuted = new List<string> ();
DropStatementsExecuted = new List<string> ();
SelectStatementsExecuted= new List<string> ();
return Result.OK;
}
示例11: RecipesWindow
public RecipesWindow(IDbHandle dbCli)
{
InitializeComponent();
DbCli = dbCli;
DataCollection = new CookingBookDataCollection(DbCli);
MainGrid.DataContext = CookinBookDictionary.Instance.GetNames(MainWindow.SelectedLanguage);
RecipeListViev.ItemsSource = DataCollection.GetFullRecipeList();
AllComponentsViev.ItemsSource = DataCollection.GetFullComponentList();
CollectionView RecipeViev = (CollectionView)CollectionViewSource.GetDefaultView(RecipeListViev.ItemsSource);
RecipeViev.Filter = (item => (String.IsNullOrEmpty(RecipeFilterText.Text) ? true : ((item as Recipe).Name.IndexOf(RecipeFilterText.Text, StringComparison.OrdinalIgnoreCase) >= 0)));
CollectionView ComponentViev = (CollectionView)CollectionViewSource.GetDefaultView(AllComponentsViev.ItemsSource);
ComponentViev.Filter = (item => (String.IsNullOrEmpty(ComponentsFilterText.Text) ? true : ((item as Component).Name.IndexOf(ComponentsFilterText.Text, StringComparison.OrdinalIgnoreCase) >= 0)));
}
示例12: GetErrmsg
public string GetErrmsg(IDbHandle db)
{
var dbHandle = (DbHandle)db;
return Sqlite3.sqlite3_errmsg(dbHandle.InternalDbHandle);
}
示例13: Changes
public int Changes(IDbHandle db)
{
var internalDbHandle = (DbHandle) db;
return SQLiteApiWin32Internal.sqlite3_changes(internalDbHandle.DbPtr);
}
示例14: BusyTimeout
public Result BusyTimeout(IDbHandle db, int milliseconds)
{
var internalDbHandle = (DbHandle) db;
return SQLiteApiWin32Internal.sqlite3_busy_timeout(internalDbHandle.DbPtr, milliseconds);
}
示例15: Close
public Result Close(IDbHandle db)
{
var internalDbHandle = (DbHandle) db;
return SQLiteApiWin32Internal.sqlite3_close(internalDbHandle.DbPtr);
}