using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.OleDb;
using System.Data;
using System.Configuration;
/// <summary>
/// Clase Conexión a la Base de Datos SIIFE PLUS
/// </summary>
namespace siife_plus
{
public class clsConexion
{
protected OleDbDataAdapter AdaptadorDatos;
protected OleDbDataReader reader;
protected DataSet data;
protected DataTable tablebd;
protected OleDbConnection oconexion = new OleDbConnection();
public void conectar(string tabla)
{
string strConexion = new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; C:\SIIFE PLUS\siifePlus.accdb);
oconexion.ConnectionString = strConexion;
oconexion.Open();
AdaptadorDatos = new OleDbDataAdapter("select *from" + tabla, oconexion);
OleDbCommandBuilder ejecutacomandos = new OleDbCommandBuilder(AdaptadorDatos);
Data = new DataSet();
AdaptadorDatos.Fill(Data, tabla);
oconexion.Close();
}
public DataSet Data
{
set { data = value; }
get { return data; }
}
public OleDbDataReader DataReader
{
set { reader = value; }
get { return reader; }
}
}
}