Questions tagged as 'linq'

1
answer

Doubt on how to set the type to return a list

I need to return some lists for my view. I am using ViewData. But have a problem, at the time of declaring the variable, I do not know what kind to put. I made the following form and it is giving the following error: foreach statement cannot...
asked by 18.09.2014 / 20:51
1
answer

LINQ with Left Join and Multiple Keys

My LINQ query does not give an error but does not display any results. Where did I go wrong? using (var db = new MyEntities()) { var result = (from dc in db.DiarioClasse join fn in db.Faltas on new { dc.Matricula, dc.CdD...
asked by 18.09.2014 / 17:40
1
answer

Working with Entity Framework, Multithreading and SQL Server in C #

I'm using Entity Framework and Multithreading in a C# project and I'm experiencing connection problems with SQL Server . Well, I wanted to improve the speed of data searches for a grid because they are very time-consuming...
asked by 13.10.2014 / 21:14
2
answers

Make a foreach inside a cshtml (view) from a controller

I made a code using Linq and jQuery . It turns out that it is giving me a problem that I can not solve, which is to dynamically create a Treeview . Then I had another idea. Make foreach direct in View (cshtml). Here's the question,...
asked by 11.09.2014 / 18:53
1
answer

Left join in linq is giving error in more than two table

I made this link: var resultado = ( from pdv in db.T_PDV join tarefa in db.T_TarefaParceiro on pdv.CNPJ equals (tarefa.CNPJ) into _trf from g1 in _trf.DefaultIfEmpty() join parceiro in db.T_OsParceiro on tarefa.IDTarefaParceiro...
asked by 13.06.2014 / 21:32
1
answer

Query Dynamica Linq

I need to create a dynamic query, in which the% L DayOfWeek.Monday variable is dynamic, how can I define it? DataClassesPDataContext pe = new DataClassesPDataContext(); var qry = from p in pe.R join q i...
asked by 03.04.2014 / 10:25
1
answer

Problem updating database data using LINQ to SQL

I'm developing a C # ASP.NET application in which I look for certain data from the database, I put it in a form, and when I click 'Save', I want the database to save the changes I made. I'm using Linq to SQL. The code below, at the end, calls...
asked by 17.07.2014 / 15:38
0
answers

How to create the event for a textbox in runtime?

foreach (SobralFoodContext.Produto produtos in categoria) { string str = "<div class=\"col-sm-4\"><div class=\"card\"><div class=\"pricing-list dark-pricing\"><div class=\"prc-head\"><h4>" + produtos.Nome + "<...
asked by 12.12.2018 / 14:07
1
answer

Break apart date to load in javascript

I have in the DB a DateNode field, where it is stored in the format YYYY-mm-dd. I have a javascript function that scans the table by the last CPF. If there is registration for the CPF, then it mounts the fields in the form. It turns out that the...
asked by 19.03.2014 / 18:49
1
answer

Doubt when searching for items with Entity

Well, I have to get all the sales items done. Every item is recorded with a CARRINHOID on a sale, on the sales table I have the CARRINHOID. How do I get all these items? I made this code: public static List<ItemVenda> BuscarItensPorVenda...
asked by 11.11.2018 / 02:41