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
}
}
|