Questions tagged as 'linq'

1
answer

How to save the checks from a checkbox to the database?

I developed an application in WPF with C #. I have a window that contains a Combobox where the Items are composed of Checkbox with a foreach result of a table. My question is: How do I keep in the database with LINQ, the checkbox check that are...
asked by 12.12.2018 / 18:55
1
answer

Error Intentun Savechanges () Entity Framework 6 ASP.Net MVC5?

When I update my gender object, it brings the date of creation with the following data, which should not because it has a value assigned in the database, I get the following date: The error that shows me when I try to do the savechan...
asked by 31.12.2018 / 14:57
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
1
answer

Is it possible to obtain two independent results (sum) from a single query in LINQ?

I am modifying a program and I want to obtain two sums independently of the id and save them in independent variables one of another. It would also be useful to obtain a table resulting from a line with only the two columns added. With this e...
asked by 22.08.2018 / 12:18
1
answer

IErrorInfo.GetDescription error with E_FAIL (0x80004005)

I have the following function which receives the path of an Excel file to open it and read it to add users, I execute it in my project from Visual Studio and it runs without problems, when I take it to the server where it should work it shows me...
asked by 24.07.2018 / 18:50
1
answer

Is it possible to make this query in linq?

SELECT CL.ClNIt, CL.ClNombresApe, VS.VsFeha, VS.VsValorNeto, VS.VsValorVisita,SUM(CC.CcValor) AS SumCupos, CL.ClSaldoCupo FROM Visitas VS INNER JOIN Clientes CL ON VS.ClNit = CL.ClNIt INNER JOIN CuposCliente CC ON CL.ClNIt = CC.CcClNit WHERE CL...
asked by 31.07.2018 / 05:10
2
answers

Someone can explain this LINQ of C # (more than all the "!" sign and contains) and convert it to a SQL Server Query [closed]

q = (from c in db.CopiasDelLibro where c.LibroId == idLib && !(from a in db.AlquileresDelLibro where a.FechaRealDevolucion.Year == 1900 select a.CopiaDelLibroId).Contains(c.Id)...
asked by 31.07.2018 / 05:15
2
answers

I try to update a record of my bd with entity framework but it does not update it (It does not mark errors)

What I want to do is a simple update of a record of my table and in this case I want to do it with linq but at the moment when it arrives at that piece of code it does not mark me any mistake and executes all the lines but it does not I update t...
asked by 27.06.2018 / 20:50
1
answer

LINQ query collects the values in keyValuePair object but then I can not save them all in the list

The following query LINQ takes all the parameters and all the stations and uses them to create a string and also stores them in a list of key pairs / value idestacion / parameter. To avoid confusion I have to clarify that this row: from x in...
asked by 12.06.2018 / 14:23
1
answer

Linq on dictionary c #

I'm trying to make a linq on a dictionary to find a key, I have something like this, and I want to find the value of the "Hello" key: Dictionary<int, Dictionary<string, string> Datos = new Dictionary<int, Dictionary<string, stri...
asked by 21.05.2018 / 15:46