Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:13:25+00:00 2026-06-14T18:13:25+00:00

In VisualStudio 2008 I get the following error on my linq query: cannot convert

  • 0

In VisualStudio 2008 I get the following error on my linq query:

cannot convert sourcetype ‘System.Linq.IQueryable’ to target type ‘string’

This is the query:

  var query = (from c in model.ITEMLIST
               select new ItemList
                        {
                          LineNo = c.LINE_NO,
                          SupplierName = from s in model.VENDOR where s.ID == c.ID_VENDOR select s.NAME
                                                     });

If I run the same query in LinqPad it returns with success the expected result

I am using LinqToEntity for this.
In another project where I am using LinqToSql I have a similar query which runs fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:13:27+00:00Added an answer on June 14, 2026 at 6:13 pm

    Your problem is this line

    SupplierName = from s in model.VENDOR where s.ID == c.ID_VENDOR select s.NAME
    

    SupplierName is a string but the right hand side is a query. Try assigning the only result in the query instead.

    SupplierName = 
        (from s in model.VENDOR where s.ID == c.ID_VENDOR select s.NAME).Single()
    

    or, in the style I prefer

    SupplierName = model.VENDOR.Single(v => v.ID == c.ID_VENDOR).NAME;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error in Visual Studio 2008: error C2248: 'Town::Town' : cannot
I am using Visual Studio 2008 and I get the following error message when
I get the following error when running my Visual Studio 2008 ASP.NET project (start
Hi upon compiling this code in Visual studio 2008 i get the following error
How do you get this window in VisualStudio 2008: alt text http://sarathc.files.wordpress.com/2008/09/image-thumb6.png I am
When debugging in Visual Studio 2008 I get the error There is no source
When I run my MSTest tests in Visual Studio 2008 Team System and get
I get the following error: Error 1 error C3867: 'CHelloproxy::Hello': function call missing argument
From time to time I get the following error when starting the debugger in
Why do I get the following error? Unsafe code may only appear if compiling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.