Variables
private Empleados emp;
private SqlDataReader registro;
private Empleados emp; private SqlDataReader registro;
en load
this.emp = new Empleados(); registro = this.emp.getempleado();
this.emp = new Empleados();
registro = this.emp.getempleado();
public class Conexion {
public class Conexion
{
private SqlConnection conexion;
public Conexion()
{
string s = System.Configuration.ConfigurationManager.ConnectionStrings["RRHHBD"].ConnectionString;
this.conexion = new SqlConnection(s);
}
public void conectar()
{
this.conexion.Open();
}
public void cerrar()
{
this.conexion.Close();
}
public SqlConnection getConexion()
{
return this.conexion;
}
}