⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbmanager.cs

📁 一个通用的数据库访问层
💻 CS
字号:
using System;
using System.Data;
using System.Data.OleDb;
using System.Windows.Forms;
using YariSoft.DBUtil;

namespace YariSoft.DBCommander
{
	public class DBManager : IManager
	{
		#region Constructor/Destructor
		public DBManager( OleDbConnection Connecton, SchemaGenerator SchemaGenerator )
			: base ( Connecton, SchemaGenerator )
		{
		}
		#endregion

		#region Public functions
		public override DataView FillData( object SelectValue )
		{
			if( this.Initialized ){
				return this.GetData( SelectValue );
			}
			bool result = false;
			DataView view = null;
			if( this.connecton.ConnectionString != "" ){
				result = this.schema.BuildSchema( this.connecton );
			} else {
				result = false;
			}
			if( result ){
				view = this.GetData( SelectValue );
				if( view == null ){
					result = false;
				}
			}
			if( result ){
				this._initialized = true;
			}
			return view;
		}

		public override DataView GetData( object SelectValue )
		{
			this.schema.Tables.DefaultView.AllowNew = false;
			return this.schema.Tables.DefaultView;
		}
		#endregion
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -