Questions tagged as 'linq'

0
answers

Does not contain a definition for InsertOnSubmit

After receiving the data I try to insert them, however InsertOnSubmit sends me a message that says "DBSET does not contain a definition. BastionContext ctx = new BastionContext(); vehiculos_bastion us = new vehiculos_bastion {...
asked by 24.11.2018 / 00:34
0
answers

Consult related tables (Many to Many), grouping results C # Linq Asp.Net MVC

I have a problem. I have 2 tables (Matricula and ValorAsistencia) that are related to an intermediate table "Assistances" (many to many). What I want is to make a query that shows me data of the first table, and then a column with the sum...
asked by 22.11.2018 / 23:42
0
answers

Because Include does not bring the users with whom it is related, only the accounts

Good day I currently have three tables for the subject (Subject), user and the relation materia_usuario (Enroll_Teacher_Subject). I am making a query in the controller in which I want to show me the subject and the relations with the table mater...
asked by 19.11.2018 / 15:41
1
answer

Query Linq C #

I have a small problem and I find a solution. I have to take the name of a person and with the name of the school DB_Entities db = new DB_Entities(); // es generada por el Entitie framework public JsonResult GetPersona(string...
asked by 25.10.2018 / 18:36
0
answers

Load and filter a table in html, MVC, ASP using recursive linq?

I'm doing a table using HTML in ASP.NET MVC. I am uploading the information on the company's income statement, and there are quite a few records, and when loading the table it takes a long time, as well as wanting to filter information, as it re...
asked by 14.10.2018 / 09:20
1
answer

Raw Entity Framework

I'm trying to call a SQL Server query from Raw var result = context.Database.SqlQuery<UniversalExtend>("SELECT distinct(PC.ProductoCatalogoId)," + " P.Nombre + ' ' + PL....
asked by 09.10.2018 / 08:06
0
answers

Convert Query SQL to Linq

I need to convert this query to linq. select CONVERT(date, tt.FechaHora) , k.Numero ,MAX(FechaHora) ,MIN(FechaHora) ,count(case when tt.EstadoTransaccionID=1 then TransaccionID else null end) ,count(case when tt.EstadoTransaccionID=2...
asked by 08.10.2018 / 20:18
0
answers

How to format the data in a DataGridView in windows forms

I have a datagridview that I want to pass data from 2 tables and some columns have numeric values that I want to convert to a corresponding text. What is the best way to make these conversions? I am using LINQ for queries. Thanks     
asked by 15.10.2018 / 08:11
0
answers

Two Sums in the same table with clauses Where

I am new to using LINQ lambda expressions and I have to make a query in a table called stock and it has attributes id, prodId, prodCode, Quantity, status, ubicacion knowing that status can be available or not available, what...
asked by 27.09.2018 / 20:45
2
answers

Add two columns in LinQ

I am trying to add two columns from a class, but I am manipulating them with LinQ I have understood that you can add but I can not find you, my code is the following, I would greatly appreciate your help. var Query = (from c in Concepto...
asked by 27.09.2018 / 01:19