Advertisement

03.24.2008 at 10:22AM PDT, ID: 23264636
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Strong Type Perfered in LINQ to SQL Queries

Tags: .NET, LINQ, C#, VB, Visual Studio 2008 .NET 3.5, Cannot implicitly convert type 'System.Linq.IQueryable<AnonymousType#1>' to 'System.Linq.IQueryable<T>'. An explicit conversion exists (are you missing a cas, LINQ to SQL
It appears the following code cause a problem that took me an hour and half to find the solution to.  There was only one related artice on the web I could find, so I thought I would post the problem and solution here since this site is indexed better and more offten.

  I kept getting a build error message for a complet LINQ query where I only wanted to select cirtian fields from the table.  I had used Anonmyous types before with no problems why now.

  The error message was the 'An Explicit conversion exsists, (are you missing a cast?)'

  No nothing was casted or appeared to need it I only wanted to return the result of the query as an IQueryable.
  That is the problem.  solution to follow.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
public static IQueryable GetEmployeejobType_DropDown(String EmployeeId)
{
 
	NTKSDataContext ntks = new NTKSDataContext();
 
	var jobType = from n in ntks.Employee
			where n.DelFlag != true
			select n;
 
	if (EmployeeId != null && EmployeeId != "")
	{
		jobType = from n in jobType
			where n.EmployeeID == EmployeeId
			select n;
	}
 
	jobType = from n in jobType
		orderby n.jobType
		select new { Description = n.jobType.PESDescription, JobNo = n.JobNo, Company = n.jobType.CompanyName };
 
	return (IQueryable)jobType;
}
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: awykel
Solution Provided By: awykel
Participating Experts: 0
Solution Grade: A
Views: 99
Translate:
Loading Advertisement...
03.24.2008 at 10:28AM PDT, ID: 21195066

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628