Can LINQ be asked to Skip/Leave particular indexes?

stackoverflow.com - 2012-04-21 12:34:24 - Similar - Report/Block

I myself am a big fan of LINQ. The art of brevity is reflected in LINQ. Also in .Net we say that LINQ is a step ahead of loops or we can say LINQ is loops++. But is it really this way? Why i am being judgmental is because i was trying to convert this for loop code to LINQ but was confused that do LINQ skip/Leave indexes? double[] NMD = {3...

transforming to linq

stackoverflow.com - 2012-03-28 13:39:00 - Similar - Report/Block

Is it possible to transform following code to Linq that it will look like little bit more nicely foreach (var entry in bottleneck.Item2) { if(entry.ChangeoverTime > 0) { avarangechangeOverTimes += entry.ChangeoverTime; ++counter; } if (entry.ChangeoverTime > maxchangeOv...

Conversion from `XPathNodeIterator` to `linq`

stackoverflow.com - 2012-07-16 10:10:41 - Similar - Report/Block

I am updating some old code of mine and decided to change everything XML related from XPath to Linq (So learn linq meanwhile). I came across this code, Can someone please tell me how to translate this to a linq statement? var groups = new List<string>(); XPathNodeIterator it = nav.Select("/Document//Tests/Test[Type=' Failure']/Groups...

C# Using .Select and .Where in a single LINQ Statement

stackoverflow.com - 2012-02-23 10:34:07 - Similar - Report/Block

I need to gather Distinct Id's from a particular table using LINQ. The catch is I also need a WHERE statement that should filter the results based only from the requirements I've set. Relatively new to having to use LINQ so much, but I'm using the following code more or less: `private void WriteStuff(SqlHelper db, EmployeeHelper emp)...

Linq expressions with Linq to Entities

stackoverflow.com - 2012-02-28 22:09:36 - Similar - Report/Block

I'm trying to wrap some repetitive code in an extension method, to clean things up a bit. The pattern I'm trying to avoid is checking if a string (normally a control's text value) is null/empty, and if it is, comparing it using Contains to a field in my data. Obviously the field isn't hard-coded into my extension, neither is the object ty...

Applying LINQ to Entities to a WCF Service

packtpub.com - 2013-02-05 10:44:58 - Similar - Report/Block

In this article by Mike Liu, the author of WCF 4.5 Multi-Layer Services Development with Entity Framework, we will learn how to update a product with LINQ to Entities in the data access layer. We will see how to apply changes of a client object to LINQ to Entities and leave all of the update work to LINQ to Entities, and will also see how...

Select two fields out of three fields from Json data using Linq.js

stackoverflow.com - 2013-02-28 08:07:23 - Similar - Report/Block

I need to select two fields out of three fields from Json data using Linq.js Required output should be [{ "A": -27, C: "country 1" } , { "A": 28 , C: "country 2"} ] using "linq.js" from following path: [ https://raw.github.com/gist/1175460/fb74 04d46cab20e31601740ab8b35d99a584f941/lin q.js Sample data var Data = [{ "A": -27, "B": -39, C: "...

How can I divide a DateTime field into intervals using LINQ-to-Entities?

stackoverflow.com - 2012-06-28 01:49:37 - Similar - Report/Block

I have the following line of code: group p by new DateTime((p.DateTime.Value.Ticks / interval.Ticks) * interval.Ticks).TimeOfDay This works great in LINQ-to-Objects but it will not work in LINQ-to-Entities. I have two quetsions: Why does it work? I don't understand how dividing the time by an interval and then multiplying it by that same...

Using Viewmodel and datepicker with Dotnet Highchart in MVC

stackoverflow.com - 2012-05-10 17:29:20 - Similar - Report/Block

I am using Dotnet Higcharts that is based on C# code that has output code javascript. Dotnet HighChart This is almost how my chart looks like: I am using data from my database to give this chart data by using LINQ queries. I have a column "Completed Date" in my entity and I need to make two textboxes with datepicker so user can choose Sta...

Query Microsoft Access MDB Database using LINQ and C#

stackoverflow.com - 2008-11-17 15:02:09 - Similar - Report/Block

I have a *.MDB database file, and I am wondering if it is possible or recommended to work against it using LINQ in C#. I am also wondering what some simple examples would look like. I don't know a lot about LINQ, but my requirements for this task are pretty simple (I believe). The user will be passing me a file path to Microsoft Access MD...

LINQ equivalent in Rails

stackoverflow.com - 2012-04-09 12:39:23 - Similar - Report/Block

I am new to Rails, and i am wondering is there any concept like LINQ in Rails? I am trying to store values in an object and query the object without saving it in database, as like in LINQ? is it really possible in Rails? Please suggest. thanks.

How to express in LINQ, an SQL OrderBy clause over two fields

stackoverflow.com - 2012-03-21 14:30:56 - Similar - Report/Block

I need to write the following SQL statement in LINQ lambdas SELECT * FROM product ORDER BY ProductScore DESC, ProductID ASC I guess this code: product.OrderByDescending(m => m.ProductScore).OrderBy(m => m.ProductId) it is not equivalent since the second OrderBy will overwrite the first one. Is there any equivalent? Thanks...

evolveStar Join

How to implement the equivalent functionality to a custom IComparer for Linq to Entities OrderBy()?

stackoverflow.com - 2012-05-17 23:20:25 - Similar - Report/Block

How can I implement the equivalent to a custom IComparer for Linq to Entities OrderBy()? A custom comparer is not supported in Linq to Entities as MSDN documentation states: Most of the LINQ ordering methods are supported in LINQ to Entities, with the exception of those that accept an IComparer, because the comparer cannot be translated t...

Can LINQ to SQL generate TSQL containing the ISNULL function?

stackoverflow.com - 2012-06-15 06:38:05 - Similar - Report/Block

I was wondering whether anyone knows definitively if LINQ to SQL has the capability of generating TSQL code that contains the ISNULL function? I'm aware that using the coalesce operator ( ) in a query: from o in Table where (o.Field ?? 0) > 0 select o will cause LINQ to SQL to emit the COALESCE function: SELECT [t0].[Field] FROM [Tab...

Java LINQ -like functionality [closed]

stackoverflow.com - 2011-10-11 22:30:36 - Similar - Report/Block

Possible Duplicate: LINQ for Java tool In C# there is a capability to use LINQ statements in order to access a Collection as if writing a SQL statement. I would like to create a similar plug-in for Java and was wondering you guys had any advice for how to go about doing this? I would like to make it as similar to SQL as possible.

Does LINQ convert queries to SQL

stackoverflow.com - 2012-07-22 18:26:59 - Similar - Report/Block

I'm a newbie to both the Entity Framework (EF) and LINQ. My question's a little lengthy but really very simple. If I create a query to retrieve data from my RDBMS using LINQ, say: using (MyEntities myEntities = new MyEntities()) // ... var query = from rec in myEntities.SomeTable where rec.Id == someId select rec; // ... When ultimat...

Linq: Adding Extra 'Where' Clause Gives Random Results

stackoverflow.com - 2012-02-28 16:04:34 - Similar - Report/Block

I'm a beginner in using Linq and a lot of it is completely confusing right now. I downloaded and used the LinqFlickr library from http://linqflickr.codeplex.com . I think however that this is just my lack of understanding about Linq. There isn't much documentation on the LinqFlickr project for me to go on. If I run the following code, if...

linq to xml getting value of an attribute out of web.config

stackoverflow.com - 2013-04-10 08:42:25 - Similar - Report/Block

Hello I got the following problem. I want to get the value of the baseLocation(D:\NewSites\TEST ) out of the following code using linq I tried a few things but it doesn`t seem to work. Any ideas how this would be done? Thanks in advance. Trustos I started with something like this but this returned null XDocument document = XDocument.Load(...

Using LINQ to SQL to get distinct value of an IQueryable resultset

stackoverflow.com - 2012-04-30 14:45:00 - Similar - Report/Block

I am using LINQ to SQL (through a DBML) that I need to limit and I am having an issue. I am using dynamic LINQ and sending in variables that are determined previously by the end user. I have a VIEW in the db that holds (via left outer joins) data from the main db table and 5 tables connecting to it. Because I am (and have to be) using dyn...

Convert string to Int in LINQ to Entities ?

stackoverflow.com - 2011-09-13 11:28:39 - Similar - Report/Block

I have to convert a srting value to Int but it seems Linq to entities does not support this. for the following code, I have geting er error. Does anyonw know how to convert a string to int. var query = (from p in dc.CustomerBranch where p.ID == Convert.ToInt32(id)// here is the error. select new Location() {Name=p.BranchName,Address=p.

The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities

stackoverflow.com - 2011-12-02 09:03:03 - Similar - Report/Block

public List GetpathsById(List id) long[] aa = id.ToArray(); long x; List paths = new List(); for (int i = 0; i < id.Count; i++) x = id[i]; Presentation press = context.Presentations.Where(m => m.PresId == aa[i]).FirstOrDefault(); paths.Add(press.FilePath); return paths; In this code i have a an exaption: Buy when I instead of aa[i...

LINQ join multiple tables on same column

stackoverflow.com - 2012-06-13 18:11:13 - Similar - Report/Block

I have a table names TestNotifications which has a CompanyID and a TestCompanyID. Those IDs link to a Companies table which has a companyName column. I need to get the companyName for the company and testCompany. The code below isn't working, I'm getting a cannot implicitly convert error. Any help appreciated. testNotifications = from t...

how can we assign an Observable collection through EF LINQ statements

stackoverflow.com - 2012-05-17 23:02:01 - Similar - Report/Block

Is it possible to assign a collection from a database entity to an ObservableCollection using entity framework? This is what iv tried so far I tried converting the list to an ObsrvableCollection using a constructor..but LINQ does not allow constructors which accept parameter. Creating an extension for Ienumerable called ToObservable colle...

Remove Column Names From LINQ Resultset

stackoverflow.com - 2012-05-03 10:31:20 - Similar - Report/Block

Don't know if my question is right or my plan is right, but i am using jquery datatable plugin and getting its datasource from a converted result. My problem was, my resultset includes the name of the columns from my datatable(ado) which I think Jquery DataTable(client) does not require. Is it possible if i dont include or rather rem...

Why is Linq to Entity Select Method flip flopping projected lists properties?

stackoverflow.com - 2013-02-25 21:00:09 - Similar - Report/Block

I'm have the strangest behavior with linq to entity / Json / MVC.net 4 I have this bit of code, and for some odd reason, every other list's property order is reversed. var output = db.FooBar.Where(a => a.lookupFoo == bar) .Select(a => new List{ //value's are the same per row //for demonstration sake. a.fooBarA, //Always 12.34 a.fooBa...

convert SQL to LINQ group by min, count

stackoverflow.com - 2012-04-28 06:34:01 - Similar - Report/Block

How convert SQL to LINQ SELECT [good_id] ,MIN([good_price]) as minPrice ,Count([distributor_id]) as distrCount FROM [Provizor].[dbo].[PRICES] where region_id=22 GROUP BY [good_id] ORDER BY distrCount desc How to do this in LINQ grouping...

How to use "contains" or "like" in a dynamic linq query?

stackoverflow.com - 2010-03-16 16:27:24 - Similar - Report/Block

The help file that came with Dynamic Linq in the CSharpSamples.zip does not show any examples of using contains or like. Are there any simple workarounds for doing this? i.e where (col like @col) doesn't work.

Many to many in LINQ to SQL

stackoverflow.com - 2012-03-14 18:27:49 - Similar - Report/Block

In my database I have a customer, who can have multiple locations and a location can have multiple customers. I have dragged my database design into a Linq To SQL dataclasses file and this is how it currently looks. In my form I am trying to retrieve the adress (or multiple) from a customer. I have tried the following code but I always ge...

bulk delete in linq - mvc4

stackoverflow.com - 2012-07-21 14:27:29 - Similar - Report/Block

I'd like to bulk delete records from a table using linq. There's a post that describes how to do it: Bulk-deleting in LINQ to Entities var query = from c in ctx.Customers where c.SalesPerson.Email == "..." select c; query.Delete(); But the function "Delete" doesn't exist in my var variable. Furthermore, the function "SubmitChanges" does...

Possible to use Linq outside a Repository without leaking provider and still filter inside a database?

stackoverflow.com - 2012-04-18 03:27:39 - Similar - Report/Block

Is using Linq to construct a query outside a Repository while still filtering data at the database possible without exposing/leaking Linq to Entities outside a repository? Obviously I could construct lamba expressions as parameters to the Query() method or even specification objects, but I was hoping to somehow use Linq to create efficien...

Using LINQ with MySQL database that can change in production

stackoverflow.com - 2012-05-07 19:43:56 - Similar - Report/Block

I'm writing database code for an MVC3 app that uses MySQL and must support dynamic views. After development is complete, the app must show new columns that were added to the database correctly. Because of this dynamic requirement, I don't think that I can use Entity Framework. I've got something going using regular string queries, but I'...

Concise syntax to invoke instance methods after invoking LINQ methods

stackoverflow.com - 2012-06-09 15:13:18 - Similar - Report/Block

I have a type that wraps an IEnumerable<T> and contains some additional logic, implementing an interface which we'll call IMyIterable<T> . On one hand, I want people to use LINQ methods to filter and process IMyIterable<T> (by actually applying them to the underlying object), but on the other hand, I still want to flue...

Use LINQ to find duplicated rows (with list of specified columns)

stackoverflow.com - 2013-03-01 15:26:12 - Similar - Report/Block

I use the code below to get the duplicated rows for 3 columns: String, Date, Money. I wonder if there is any general method that I can input a dynamic List of column name in this LINQ to find duplicated rows? DataTable allDuplicates = dt.AsEnumerable() .GroupBy(dr => new Field1 = dr.Field("String"), Field2 = dr.Field("Date"), Field3 =...

Linq Expression - How to initialize with Expression.And properly?

stackoverflow.com - 2012-06-20 13:30:10 - Similar - Report/Block

I am busy writing an dynamic AND filter on a IQueryable Linq object, so far this is my code and it works: public static IQueryable<T> FilterHeaders<T>(this IQueryable<T> records, IEnumerable<ListHeader> headers) // Build linq expression to filter queryable if (headers != null) { var param = Expression.Parameter...

Dynamic Linq query on List using Predicate Builder

stackoverflow.com - 2013-03-20 17:01:22 - Similar - Report/Block

I'm using C# 2010 .NET 4.0 and I have a List collection returns that I needing to build a dynamic LINQ query on. I'm utilizing the Predicate Builder referenced here This works fine if I have 1 filter criteria, but if I have 2 or more, then, when the query.compile() is called, I get this error: variable 'tmp' of type 'Check21Tools.Incomi...

سوال: چگونه از دستورات linq در sqlite استفاده کنید؟

barnamenevis.org - 2013-04-11 14:45:30 - Similar - Report/Block

سلام میخواستم بپرسم چطوری میشه از طریق دستورات linq به دیتابیس متصل شد و اطلاعات رد و بدل کرد؟ آیا دستورات linq در sqlite مانند دستورات linq در sql است؟؟ لطفا راهنمایی کنید (هر چند که ما هر سوالی توی این انجمن پرسیدیم آخرش خودمون به جواب رسیدیم) مرسی...

سوال: ساخت منوی عمودی با ارتباط دیتابیس از طریق LINQ

barnamenevis.org - 2013-02-11 16:25:54 - Similar - Report/Block

ساخت منوی عمودی با ارتباط دیتابیس از طریق LINQ سلام بچه ها / من میخوام یک منوی عمودی درست کنم و آیتم هاش رو با دیتابیس پر کنم / من با (LINQ) کار میکنم / مشکلم اینجاست که وقتی منوی آماده (ASP) رو برمیدارم و در قسمت (Choose Data Sourse) و در قسمت (Choose a Data Sourse Type) اصلا (LINQ) را نمیبینم که دیتا سورس درست کنم بچه ها من کلا ارتباطها...

پیغام موقع ادد کردن linq

barnamenevis.org - 2013-05-17 21:45:18 - Similar - Report/Block

سلام. وقتی میخوام linq را add میکنم. پیغام زیر نمایش داده میشه:...

سوال: تبدیل خروجی linq به datatable

barnamenevis.org - 2013-03-07 09:08:56 - Similar - Report/Block

از یک وب سرویس ما خروجی خاص خودش رو می گیریم . بعدش توسط linq فیلدهای مورد نظر رو انتخاب می کنیم. حالا احتیاج داریم که این خروجی رو توی یک datatable هم داشته باشیم روال قبلی نوشته شده این گونه بود که ستون ها ساخته می شدن بعدش توسط دو حلقه تو در تو اطلاعات در datatable اضافه می شدن . در متد جدید از تبدیل خروجی linq به IEnumerable استفاده ش...

ایجاد یک گزارش به صورت اکسل یا پی دی اف از نتایج کوئری LINQ

barnamenevis.org - 2013-05-13 19:15:39 - Similar - Report/Block

سلام دوستان یک راه ساده میشه معرفی کنید که یک کوئری LINQ رو به صورت pdf یا excel ذخیره کنم...


Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.

Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !

evolveStar.com provides a search engine that allows you to gather information to write their own blog.

evolveStar.com enhances the sources displaying the logo of the site.

If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com

Specifies the subject copyright violation and the url of the page

evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.

Next will be effectual and relevant checks.

Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.