Questions tagged as 'linq-to-sql'

4
answers

Convert Left Join SQL to Linq C #

How can I convert the following SQL query to Linq? SELECT Facturas.IDFactura, SUM(MovimientosDineros.Valor) AS Totalaportado FROM Facturas JOIN MovimientosDineros ON Facturas.IDFactura = MovimientosDineros.IdFactura GROUP BY Facturas.IDFactura...
asked by 06.06.2017 / 06:14
2
answers

Left join using Linq C #

I have the person table in which there are 100 people of which 80 are students, of those 80 only 50 are enrolled, I try to make a left join (Sql Server) to show me the student that exists, even if not are enrolled The table that stor...
asked by 30.12.2018 / 19:18
3
answers

How to convert query from sql to linq?

I need to convert the following query to linq select * from detalle_pedido where articuloid = 13555 and id_pedido=13 I've tried it in the following way var querydetalle = _db.detalle_pedido.Where(dt => dt.articuloid == articu.articuloi...
asked by 30.10.2018 / 16:36
1
answer

Problems using LINQ to SQL

I try to bring a data collection using LINQ to SQL but when I run the app it gives me an error, I'm using Visual Studio 2012 SQL Server 2008, Windows Forms app. private IEnumerable<Customers> ListarCustomers() { using (North...
asked by 01.11.2016 / 19:07
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

Alias in Linq in the Select new

var query1 = from ra in contexto.RADICACIONES join us in contexto.USUARIOS on ra.ID_USUARIOS_FK equals us.ID_USUARIOS join usex in contexto.USUARIO_EXTERNO on ra.ID_USUARIO_EXT_FK equals usex.ID_USUARIO_EXT...
asked by 18.04.2017 / 15:49
2
answers

Iterate over sublists within a list

I currently have a list of the Activity class, this class, among other properties, has one that is Operational. The fact is that I take charge of all the activities of all the workers in the lAux list and what I need is from that great list t...
asked by 22.11.2017 / 13:04
2
answers

Convert DbSetT to different data type in EF - Linq

I'm working on an expression Linq in which I get an object of DBContext , and I want to convert it into an object of ViewModel My ViewModel receives as parameter an object obtained from DBContext to work the...
asked by 27.06.2018 / 14:29
2
answers

Error Selecting Records with EntityFramework

Class that receives the query data public class EngineEntity { public string FacturaId { get; set; } public string Cliente { get; set; } public int? TipoFactura { get; set; } public double? Monto { get; s...
asked by 29.10.2016 / 14:37
2
answers

How to use like in linq C #

I want to obtain a record of an existing article in the database, what I do is that in a textbox I capture the text. The fact is that with == works for some articles, but for many of these, it does not generate a null reference, I want to...
asked by 25.10.2018 / 21:49