Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports System.Diagnostics
 
namespace DataProcess_vb
	public class UseSql_vb
		dim ConnectString as string 'Á¬½Ó×Ö·û´®
		public Sub New()
			ConnectString="server=Localhost;uid=sa;pwd=;database=EmploySQL"
		end sub
		public Sub New(ServerName as string,uid as string,Password as string,DBName as string)
			ConnectString="server=" & ServerName & ";uid=" & uid & ";pwd=" & Password & ";database=" & DBName
		end sub
		public Function GetDataView(TBName as string,SQLString as string) as DataView
			Dim k as SqlConnection = new SqlConnection(ConnectString)
			Dim Comm as SqlDataAdapter = new SqlDataAdapter(SQLString,k)
			Dim DS as DataSet = new DataSet()
			Comm.Fill(DS,TBName)
			return DS.Tables(TBName).DefaultView
		end function
	end class
	public class UseACC_vb
		Dim ConnectString as string 'Á¬½Ó×Ö·û´®
		public sub New(MDBName as string)
			ConnectString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MDBName
		end sub
		public function GetDataView(TBName as string,SQLString as string) as DataView
			Dim k as OleDbConnection = new OleDbConnection(ConnectString)
			Dim Comm as OleDbDataAdapter = new OleDbDataAdapter(SQLString,k)
			Dim DS as DataSet = new DataSet()
			Comm.Fill(DS,TBName)
			return DS.Tables(TBName).DefaultView
		end function
	end class
end namespace