Questions tagged as 'linq'

3
answers

How to make a NOT IN in LINQ?

I wanted to know how to do NOT IN in the next query select * from WFRules where (Class = 'DoDesign' or ParentId = 0) and ParentType not in (5,8,9,10,11) and Type not in (5,8,9,11,15,33,34,35,37,38,3...
asked by 20.01.2016 / 20:53
2
answers

Return only one field from a list in WCF

The method is like this: public List<CivarTransporteService.Model.Cliente> getClientes() { using (CivarTransporteService.Model.CivarTransporteModelContainer context = new Model.CivarTransporteModelContainer()) {...
asked by 21.01.2016 / 03:56
3
answers

LINQ query in .NET VISUAL STUDIO

I need to translate the following query from SQL to LINQ in .NET with C #: This is the SQL query to translate: SELECT COUNT(id_documento) FROM documento I need the value to be stored in a variable or to capture the n...
asked by 08.04.2018 / 06:09
4
answers

Translate an SQL query to LINQ

I am very new using LINQ and I have done few things, right now I have an SQL query that I must implement in LINQ and I have no idea how it is done. SELECT Boletas.Boleta, DATEPART(DW, CAST(Boletas.Fecha AS datetime)) AS DiaDeLaSemana,...
asked by 28.03.2017 / 19:58
1
answer

Get the full name of a property

I am working on C #, using Linq Dynamic to do some sorting, so I was generated the need to obtain the names of the properties as string . When the properties are simple, they do not generate any conflict, since I can use nameof()...
asked by 22.11.2018 / 14:07
1
answer

Help with a query in linq

I want to make a classification so to speak of a list that I have, I'm trying to do it with linq. well this is what I want .. Result. This the information with which I count. Proveedor: Videmont Cap. Morgan = $450.12 ET. Negra = $620.32 P...
asked by 27.06.2018 / 01:42
1
answer

Exclude a list of Strings in a table in C #?

Hello friend I have a problem with a table I have a field called names within this table and I have a list of names which I want to exclude from the table based on the name field. I have the following but it does not work for me. var DataRows...
asked by 26.07.2018 / 19:27
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
1
answer

order by len () in linq

This is my query on the sql server and everything works fine select * from DetalleNotas order by len(ColProduct), ColProduct PROCT1 PROCT2 PROCT3 PROCT4 PROCT5 PROCT6 PROCT7 PROCT8 PROCT9 PROCT10 but I want my query in linq I trie...
asked by 04.05.2018 / 17:46
1
answer

Why do I return iQueryable instead of an instance of my class?

I'm getting the following error when returning an object when validating the login:    You can not implicitly convert the type 'System.Linq.IQueryable' 'to' Business.clsUser.ValidSessionU '. An explicit conversion already exists (check if a c...
asked by 14.09.2018 / 15:07