---
title: "Convert a list to a string list"  
description: "Convert a list to a string list"  
author: "Anonymous User"  
published: 2014-03-29  
updated: 2014-03-29  
canonical: https://www.mindstick.com/forum/1995/convert-a-list-to-a-string-list  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Convert a list to a string list

[var](https://www.mindstick.com/forum/33920/what-is-different-var-and-dynamic-types-in-c-sharp) listID = from Ines in ineContext.IneDetailRecords

[select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance) Ines.InePIN.ToString().ToList();

[string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) [PIN](https://answers.mindstick.com/qa/62215/which-former-indian-athlete-has-been-nominated-for-iaaf-veteran-pin) = something;

if(!listID.Contains(PIN))

// save it to DB

InePIN is a cloumn in [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server) DB, the type is [varchar](https://www.mindstick.com/forum/161878/what-is-the-difference-between-nvarchar-and-varchar)(20).

## The [exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling) is:

```
Instance argument: cannot convert from 'System.Linq.IQueryable<System.Collections.Generic.List<char>>' to 'System.Linq.ParallelQuery<string>'
```

## Replies

### Reply by Pravesh Singh

Hi Ankita,

You need to apply the ToList method on result of query but not on the selected column i.e Ines.InePIN.ToString().ToList()

Change

```
var listID = from Ines in ineContext.IneDetailRecords select
Ines.InePIN.ToString().ToList();
```

To

```
var listID = (from Ines in ineContext.IneDetailRecords select
Ines.InePIN.ToString()).ToList();
```


---

Original Source: https://www.mindstick.com/forum/1995/convert-a-list-to-a-string-list

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
