Questions for linq


2606

Using LINQ find nearby places from database

We want to receive list of nearby places from database using LINQ in ASP.NET 2012 and would like some feedback on our strategy.
8191

MvcMusicStore No elements in sequence

I am working through the Mvc Music Store tutorial and am stuck on this LINQ query as it keeps telling me that the sequence has no elements. My model matches the model in the tutorial and I have ins...
8623

Filtering Windows logs using lambda expressions on non-IEnumerable types

I'm trying to get and filter Windows logs based on some criteria, one of which is filter by Message. The Message property is in EventLog.GetEventLogs().Entries.Message. The problem is Entries is an
5497

LINQ to SQL: Multiple / Single .dbml per project?

I've read Rick Strahl's article on Linq to SQL DataContext Lifetime Management hoping to find some answers on how I would manage my .dbml files since they are so closely related to DataContext.
3204

Read CSV data in batches and Process it

I have a csv file that looks like this
493

Easiest way to convert IGrouping to IHierarchicalDataSource

I have a list of business objects that I want to display in a menu. I can quickly use LINQ to created nested groups to match the desired structure but have to manually iterate through each to
4268

Linq to SQL: How do I stop the auto generated object name from being renamed?

In visual studio 2008, when I drag a database table into my dbml screen, any tables that end with the letter s automatcially get the s removed from the dbml object. Is there any way to disable thi...
680

more than 1 sequence of random numbers c#, linq

i was using this code to generate a random sequence of numbers:
3063

DataGridView not sortable when AutoGenerateColumns = true + Anonymous Types?

Can DataGridView be sortable when is bound to an anonymous type? If yes, how?
2776

Add to generic List property and save in viewstate

I'm using a generic List to store a set of data in the viewstate. If I try sorting the list using linq in the get accessor then when I try to add a new item to the list if doesn't work. No error, i...
5224

Receiving Object reference not set to an instance of an object. on simple datetime retrieval from Raven

Not sure why its complaining about this error, but when comparing time stamps to DateTime.now I get a object reference error. Here is the simple code.
4268

Filter XDocument more efficiently

I would like to filter with high performance XML elements from an XML document.
6422

Making Linq operations to a database in Data Connections

I am using Visual Studo 2012 and SQLExpress.
8892

Convert Linq ObjectQuery IQueryable to IEnumerable

Totally confused about the data types required here.
472

Write and stream a templated Xml as efficiently as possible

I am trying to find the best solution to prevent us to allocate too much memory when building an Xml document. I have to construct a fairly large Xml with the less resource possible (the web servic...
477
7522

Ignoring accents in SQL Server using LINQ to SQL

How can I ignore accents (like ´, `, ~) in queries made to a SQL Server database using LINQ to SQL?
7895

.NET MVC4, Entity, Search

I have an MVC4 project using EF. I have set up my schema so that all searchable items have have a Table that relates them to a "Tags" table. I am wondering what is the most efficient way to do a full
2423

Getting from dynamic Request to a List

My code is working nicelly but I would like to know if you can suggest something more performatic to get the values frm my dynamic controls.
4609

How do I apply OrderBy on an IQueryable using a string column name within a generic extension method?

public static IQueryable<TResult> ApplySortFilter<T, TResult>(this IQueryable<T> query, string columnName)
6051

How to merge a collection of collections in Linq

I would like to be able to fusion an IEnumerable<IEnumerable<T>> into IEnumerable<T> (i.e. merge all individual collections into one). The Union operators only applies to two
3222

Linq SelectMany query

I have the following query:
610

C# Linq data structure, for eventual data binding. Best way to do?

I have a set of "parts". Each part has a name and set of attributes. An attribute is a set of string keys and values. For example:
5383

Using SequenceEqual and then returning which elements don't match

I have two List<string> and I am using the SequenceEqual method to determine if they match.
2491

Linq to FileHelpers Class

I am trying to get the results of a linq query int a file. I created and array of the same type as the FileHelpers class I created, then queried the data and assigned the values to the array I just
5952

Order by on String's substring in Linq

I have a date field for which I convert the value of the database from datetime to string format("dd-MMM-yyyy"), I need to perform sorting this string date field, but seems like when I have been do...
263

find LINQ queries in C# files

I need to find out LINQ queries while parsing C# files (with Irony Codeparser), because the parser does not support LINQ - therefore I have to exclude or modify such files, where LINQ occurs.
3133

Compiler error when replacing Lambda expression with method group

I love the Linq syntax and its power, but sometimes I just can't understand why things work as they work.
4712

Can some one help me solve this logic using C#

Below is the logic for what I am trying to do .Can some one help me solve this using C#.
8649

Add folder files to listbox by LINQ

I use the below code to get files with different extensions in the folder by LINQ, but no file is found.
9443

Is it possible to Serialize a LINQ object?

I'd like to serialize some LINQ generated objects and store them in a table as a binary field (Never you mind why). I'd like to be able to write some code that looks something like this:
7055

Trouble writing predicates to search a repository with Entity Framework (equivalent to using a Join in SQL)

We are using code first Entity Framework 4.1 to persist data. Some of our entities have a relationship like this:
6395

Handling very large strings between SQL Server and .NET code +LINQ

I have an app that needs to handle very large strings between a SQL Server database and .NET code. I have a LINQ query that generates the strings when saving them to the database, but when trying to
4656

Linq. Select from multiple tables

In project I have this tables:
8933

LINQ with FoxPro?

Is there a reasonable way to access FoxPro databases using LINQ?
1057

Determine 2 diagrams relative position using LINQ

I have two arrays of points: double[] minus and double[] plus, e.g.:
4166

The concise way to initialize an array of reference type object

I wonder if there is better way to initialize an array of reference type object, like this.
4088

linq, mvc and partial class

I have dbml with single table users
635

Which method performs better: .Any() vs .Count() > 0?

in the System.Linq namespace, we can now extend our IEnumerable's to have theAny() and Count() extension methods.
7779
7160

entity framework grouping by datetime

Every 5 minutes a row in a sql server table is added. The fields are:
1588

MVC LINQ dynamic orderBy getting column type

I am trying to dynamically order a list of products.
8716

Is there a C# unit test framework that supports arbitrary expressions rather than a limited set of adhoc methods?

Basically NUnit, xUnit, MbUnit, MsTest and the like have methods similar to the following:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.