---
title: "LINQ to SQL execute method on select"  
description: "LINQ to SQL execute method on select"  
author: "Anonymous User"  
published: 2014-09-02  
updated: 2014-09-02  
canonical: https://www.mindstick.com/forum/2232/linq-to-sql-execute-method-on-select  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# LINQ to SQL execute method on select

I’m really new to LINQ so I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to [figure](https://yourviews.mindstick.com/view/87536/what-are-ghosts-jobs-and-how-to-figure-out-them) out how to [execute](https://www.mindstick.com/interview/49/how-can-i-execute-a-php-script-using-command-line) [method](https://www.mindstick.com/forum/166/webservice-method) with [lambda expressions](https://www.mindstick.com/forum/159557/c-plus-plus-lambda-expressions-how-does-the-compiler-interpret-them).

```
   public void GetData()    {     using(MyClassesDataContext context = new MyClassesDataContext())                {                   
var problems = (from p in context.Problems select p).Take(10);                   
problems.Select(t => DisplayData(t.Text));                }    }     public void DisplayData(string Text)            {            }
```

I'm getting this [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing):

The type [arguments](https://answers.mindstick.com/qa/92535/what-are-the-different-types-of-arguments) for method 'System.Linq.Enumerable.[Select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance)(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

at this line:

problems.Select(t => DisplayData(t.Text));

What am I [doing wrong](https://answers.mindstick.com/qa/36736/what-are-indians-doing-wrong-on-whatsapp)?

## Replies

### Reply by Sumit Kesarwani

Hi Pravesh, \

I think that if you make the following change to your code, it will work fine:

problems.Select(t => { DisplayData(t.Text); return true; })


---

Original Source: https://www.mindstick.com/forum/2232/linq-to-sql-execute-method-on-select

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
