Hi karenpayneoregon
In source code work correct and load data after compile project and run EXE not load data see my Error project:
public frmEmployeeMain()
{
InitializeComponent();
}
cmdEmployee employeecmd = new cmdEmployee();
BindingSource bsEmployeemaster = new BindingSource();
//Get All Employees
public void LoadEmployeemaster()
{
List<cls_Employee> employeemaster = employeecmd.GetAllEmployee();
bsEmployeemaster.DataSource = employeemaster;
gcEmployeeMaster.DataSource = bsEmployeemaster;
}
private void frmEmployeeMain_Load(object sender, EventArgs e)
{
LoadEmployeemaster();
}
//
Repository<cls_Employee> cmd = new Repository<cls_Employee>();
public List<cls_Employee> GetAllEmployee()
{
try
{
return cmd.GetAll("exec sp_SelectAllEmp").ToList();
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show("Error:"+ex,"ERP",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Error);
return null;
}
}
//
public class Repository<T> : DataConnection, IRepository<T> where T : class
{
private IDbConnection con = ConVal();
public IEnumerable<T> GetAll(string query)
{
// con.Open();
return con.Query<T>(query);
//throw new NotImplementedException();
}
}
Best Regards.