Questions tagged as 'linq'

3
answers

Check latest registration through linq

I have to get the most updated record from the following table for the most recent record query (the most recent date) I have the following sentence contexto.Set<Tabla1>().LastOrDefault(x => x.Id_Registro == idRegistro); i...
asked by 22.03.2017 / 14:00
2
answers

File to Integer Array

Currently I have a txt file where there are many lines, each of these lines can be a string, an integer, a line break, etc ... The fact is that I'm looking for a clean way to load lines that are integers in a list of integers. Doing it by mea...
asked by 11.09.2017 / 09:19
3
answers

SQL Syntax - LINQ in C #

I'm doing a small application where I need to save data in SQL Server and then view it in a Datagrid using WPF. I'm not used to LINQ but I've already done some tests but it's not very clear to me because there are two types of syntax ... Exam...
asked by 10.09.2017 / 09:37
1
answer

Convert a switch to linq

Is there any way to convert this SWITCH to LINQ ? switch (row["grupo"]) { case "Genera ICAs": enuMetodo = TipoMovimientosStock.GeneraIca; break; case "Genera Remito de Compras": enuMetodo = TipoMovimientosSto...
asked by 12.09.2017 / 17:26
1
answer

error when returning a generic list linq

I have the following problem, when returning a list generated in a method for a viewbag it throws an error to me at the moment of the return, I put the image to them so that they see where the error throws me public List<Card> GetCar...
asked by 16.04.2018 / 17:03
2
answers

Using .Zip or linq in c # to add two fields from a series of objects contained in two lists

I have a list of objects List<Objeto> lista1; List<Objeto> lista1; Object has an attribute X and an attribute Y . I want to do the following: List<Objeto> listaSuma => add the values Y o...
asked by 11.01.2017 / 15:17
2
answers

Empty rows with OpenXml Excel

I'm going through an excel with the library DocumentFormat.OpenXml , and when I get the rows, I get rows in which the cells are empty; that is, I have an excel where you only have information in the first 10 rows, but you are extracting in...
asked by 05.02.2016 / 20:28
2
answers

Linq adds a nonexistent column to the SQL query

I'm having a problem with LINQ, using EntityFramework 6 First, to enter the context, I leave the Problem Model .. [Table("Datos_Garantizados")] public partial class Datos_Garantizados { [Key] public long Version { get; set; } public decima...
asked by 28.03.2018 / 16:18
1
answer

Stored procedure in LinQ c #

Hello developers good day, I am with a problem it turns out that my project does not have to have any stored procedure in SQLServer and they asked me to do everything from linQ the issue is that I have not found how to create the...
asked by 25.04.2018 / 18:02
1
answer

Error in method Include LinQ: Unable to load type 'System.Data.Entity.DbExtensions'

I have an application of WindowsAplication in C # , it is developed in N-Layers . The method in the data layer to get a table did not give problems: public List<styh_m_005_cultivo> GetAll() { using (var context = new TermometroDb...
asked by 24.03.2017 / 17:40