Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity framework 5: net40
    primarykey
    data
    text
    <p>I'm developing a web application with ASP.NET 4.0. I have a database SQL Server 2005 and I'm using Entity Framework 5 connecting to it.</p> <pre><code>public class ArchivioClienti : DbContext { public ArchivioClienti() : base("ICAMConnection") { } public DbSet&lt;ClientiProspect&gt; clienti { get; set; } } [Table("pvw_clienti_prospect")] public class ClientiProspect { [Key] public string tipologia { get; set; } public string cod_ppro { get; set; } public string rag_soc { get; set; } public string indirizzo { get; set; } public string cap { get; set; } public string citta { get; set; } public string prov { get; set; } public string nazione { get; set; } public string telefono { get; set; } public string fax { get; set; } public string part_iva { get; set; } public string cod_fisc { get; set; } public string note { get; set; } public string e_mail { get; set; } public string cod_ppro_anag { get; set; } public string cod_vage { get; set; } public string cod_visp { get; set; } public string fonte { get; set; } public string cod_vzon { get; set; } public decimal perc_provv { get; set; } public string flag_stato { get; set; } public string cod_anag { get; set; } public string gg_chiusura { get; set; } public DateTime? data_ins { get; set; } public string cod_canale { get; set; } } </code></pre> <p>I'm trying to get data from a table. This isn't a really table but only a view. When I load a query with LINQ,</p> <pre><code>var result = from u in dbClienti.clienti select u; return result.ToList() </code></pre> <p>I receive the correct number of results (the same that i receive with the same query in SQL Server Management studio), but with wrong fields: the first one is replicated several times, the second one the same, etc.</p> <p>Why is it working in this way? Are there any problems on Entity Frameworks with database's views?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload