Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BindingList and LINQ?

I am new with Linq and I would like to sort some data that are in the BindingList. Once I did my Linq query, I need to use back the BindingList collection to bind my data.

 var orderedList = //Here is linq query
 return (BindingList<MyObject>)orderedList;

This compiled but fails in execution, what is the trick?

like image 676
Patrick Desjardins Avatar asked Nov 25 '08 19:11

Patrick Desjardins


People also ask

What is the main purpose of LINQ?

Language-Integrated Query (LINQ) is the name for a set of technologies based on the integration of query capabilities directly into the C# language. Traditionally, queries against data are expressed as simple strings without type checking at compile time or IntelliSense support.

Can we use LINQ in .NET core?

NET Core LINQ stands for Language Integrated Query. Language Integrated Query is one structured query that is used to retrieve data from the database and other different sources and formats. LINQ tutorials will assist you to find out the LINQ language using topics that go from basic to advanced.

What is LINQ example?

LINQ is the basic C#. It is utilized to recover information from various kinds of sources, for example, XML, docs, collections, ADO.Net DataSet, Web Service, MS SQL Server, and different database servers.

What is LINQ and types of LINQ?

Introduced in Visual Studio 2008 and designed by Anders Hejlsberg, LINQ (Language Integrated Query) allows writing queries even without the knowledge of query languages like SQL, XML etc. LINQ queries can be written for diverse data types.


1 Answers

new BindingList<MyObject>(orderedList.ToList())
like image 164
leppie Avatar answered Sep 17 '22 17:09

leppie