473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Datagridview with Linq

I want to develop a datagridview allowing column selection and filtering,
like this:

http://www.codeproject.com/KB/grid/GridFilter.aspx

This example is using dataset. My question is if:
a) I use the same way, using dataset
b) I use Linq converting a query to dataset
c) or if would be done just with Linq

The objective is just for queries and not to update to the database. And
Linq would be easy in constructing these queries. So, I would like to use
Linq, but I don't want many performance lost using option b described above.

What would be the best option?

Thank you in advance,
Vanessa
Dec 11 '07 #1
2 12554
Vanessa,

You could use LINQ to DataSets to make it easier to perform your
queries, and then produce a DataView from the results. This might be the
easiest to use in your solution if you are already using data sets.

You won't be able to work with anonymous types, but you could still use
projections on non-anonymous types, but you would have to select the items
into a BindingList<T(or some other collection which implements
IBindingList, so that you could get sort functionality).

I shouldn't say you can't work with anonymous types, but given they are
not meant to be used across methods, you would have an incredibly hard time
doing so (you could technically do it through reflection, but why is beyond
me).

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:C4**********************************@microsof t.com...
>I want to develop a datagridview allowing column selection and filtering,
like this:

http://www.codeproject.com/KB/grid/GridFilter.aspx

This example is using dataset. My question is if:
a) I use the same way, using dataset
b) I use Linq converting a query to dataset
c) or if would be done just with Linq

The objective is just for queries and not to update to the database. And
Linq would be easy in constructing these queries. So, I would like to use
Linq, but I don't want many performance lost using option b described
above.

What would be the best option?

Thank you in advance,
Vanessa

Dec 11 '07 #2
Hi,

Part of the question is what is your knowledge in each feature?
Most probably you can filter it very easily using a DataView, so maybe a) is
a very easy option.
If you are strong enough on Linq (or want to just practice) you can use it
too. But frankly I would go with the option a)
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:C4**********************************@microsof t.com...
>I want to develop a datagridview allowing column selection and filtering,
like this:

http://www.codeproject.com/KB/grid/GridFilter.aspx

This example is using dataset. My question is if:
a) I use the same way, using dataset
b) I use Linq converting a query to dataset
c) or if would be done just with Linq

The objective is just for queries and not to update to the database. And
Linq would be easy in constructing these queries. So, I would like to use
Linq, but I don't want many performance lost using option b described
above.

What would be the best option?

Thank you in advance,
Vanessa

Dec 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's...
0
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by...
0
by: bizdata | last post by:
Hello In C# I am trying to populate a grid view with a result of a LINQ Query as follows: dc stands for DataContext var ItemList = (from items in dc.Products select new { items.ItemCode,...
18
by: Andrus | last post by:
Marc, Thank you very much. I have issue on implementing add row properly using this. User presses down arrow in last row in grid starting adding new row. Then user changes its mind desiding...
1
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two...
0
by: =?Utf-8?B?Tmljaw==?= | last post by:
Hello, I've got a DataGridView that I have bound to a stored procedure. I'm using LINQ, so this is basically what I have (this was created using SQLMetal): public...
0
by: =?Utf-8?B?Qm9i?= | last post by:
I have a datagridview bound to a linq-to-sql dataset expenses. The grid has columns for Description, Amount and Tax Rate. The Description column has an AutoComplete source derived from another...
3
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows...
6
by: Ciaran | last post by:
I'm having a really strange issue with the DataGridView control in a VS2008 / .NET 3.5 winforms project. I have a simple form with a grid. In the form constructor I call a function to bind the grind...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.