using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Diagnostics;
 
namespace DataProcess{
	public class UseSql{
		string ConnectString ;//Á¬½Ó×Ö·û´®
		public UseSql(){
			ConnectString="server=Localhost;uid=sa;pwd=;database=EmploySQL";
		}
		public UseSql(string ServerName,string uid ,string Password ,string DBName){
			ConnectString="server=" + ServerName + ";uid=" + uid + ";pwd=" + Password + ";database=" + DBName;
		}
		public DataView GetDataView(string TBName,string SQLString){
			SqlConnection k = new SqlConnection(ConnectString);
			SqlDataAdapter Comm = new SqlDataAdapter(SQLString,k);
			DataSet DS = new DataSet();
			Comm.Fill(DS,TBName);
			return DS.Tables[TBName].DefaultView;
		}
	}
	public class UseACC{
		string ConnectString ;//Á¬½Ó×Ö·û´®
		public UseACC(string MDBName){
			ConnectString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + MDBName;
		}
		public DataView GetDataView(string TBName ,string SQLString){
			OleDbConnection k = new OleDbConnection(ConnectString);
			OleDbDataAdapter Comm = new OleDbDataAdapter(SQLString,k);
			DataSet DS = new DataSet();
			Comm.Fill(DS,TBName);
			return DS.Tables[TBName].DefaultView;
		}
	}
}