Dynamic Data Access with LINQ

When I talk about LINQ people often ask whether it’s possible to have dynamic queries with LINQ. An example of this is presenting the user with a UI that allows them to optionally filter by some criteria or other and sort by some criteria. This was straightforward if you built-up a SQL string in code.

The compiled, static nature of LINQ makes dynamic queries appear difficult at first. They are not and this video and sample application shows you how to accomplish just this.

 Screen shot of sample application

You can download the source code here:

Kennedy-Dynamic-Linq.zip (88.34 KB)

3 comments

  • Hi, I’m trying to follow your video on LINQ, but to replicate code I need a database you used. Could you please share info on what database you used as example.
    Thanks in advance.
    Jozo

  • Hi, I was trying to follow your video and use your code but data source is missing. Could you please share info where to find data source you used in video?
    Thanks and regards.
    Jozo

Submit a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s