dbmanager.cs

来自「一个通用的数据库访问层」· CS 代码 · 共 51 行

CS
51
字号
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 + =
减小字号Ctrl + -
显示快捷键?