As a result of my first consultation in this forum, I was suggested to use EF, I am actually learning and it saves me a lot of time in terms of entities, but now I have this problem.
I have 4 Data Layers, Entity, Business and Presentation.
In my every Data I have
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entidad;
namespace Datos
{
public class DPolizas
{
public List<POLIZAS> GetPolizas()
{
var Query = (from p in db.POLIZAS
select new POLIZAS
{
ASE_CODIGO = p.ASE_CODIGO,
CLI_CODIGO = p.CLI_CODIGO
}).ToList();
return Query;
}
}
}
In my business layer I have
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entidad;
using Datos;
namespace Negocio
{
public class NPolizas
{
public List<POLIZAS> GetPolizas()
{
DPolizas dPolizas = new DPolizas();
return dPolizas.GetPolizas();
}
}
}
and I have a form with a datagriview and a button for the query and test my code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Entidad;
using Negocio;
namespace Rsa
{
public partial class frmPolizas : Form
{
public frmPolizas()
{
InitializeComponent();
}
private void btnListar_Click(object sender, EventArgs e)
{
List<POLIZAS> lista = new List<POLIZAS>();
NPolizas nPolizas = new NPolizas();
lista = nPolizas.GetPolizas();
dgvPolizas.DataSource = lista;
}
}
}
and when I press the List button it only shows me the header and it does not bring me data even though I have many records in this table ?? What am I doing wrong??
Apparently says it can not find a connection string, however if I have app.conf
Thanks for any help you can give me.