codeice / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

Could not find an implementation of the query pattern for source type 'LinqToExcel.Query.ExcelQueryable<LinqToExcel.Row>' #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Downloaded LinqToExcel 1.5
2.Added references to LinqToExel.dll and Remoting.Data.Linq.dll in VS2010 to a 
.Net 4.0 Web project
3. used in this code:
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Data.Common;
using System.Data;
using System.Net;
using System.Xml;
using System.IO;
using System.Data.OleDb;
using System.DirectoryServices;
using System.Collections.Generic;
using System.Data.SqlClient;
//using Excel = Microsoft.Office.Interop.Excel;
using LinqToExcel;

public class GenericConnection
{
    public GenericConnection() { }

    public DbConnection DBConn { get; set; }

    public string Filename { get; set; }

}

public class ExcelSource 
{
  public DataSet GetResults(GenericConnection conn, params string[] strQuery)
    {

        try
        {
            var excel = new LinqToExcel.ExcelQueryFactory();
            excel.FileName =conn.Filename;
            var results = from res in excel.Worksheet(strQuery[0])                          
                          select res;
....

Compiler throws up error on the line "excel.Worksheet(strQuery[0])" with the 
following full message:
"Could not find an implementation of the query pattern for source type 
'LinqToExcel.Query.ExcelQueryable<LinqToExcel.Row>'.  'Select' not found.  Are 
you missing a reference to 'System.Core.dll' or a using directive for 
'System.Linq'?"

What is the expected output? What do you see instead?
A successful build

What version of the product are you using? On what operating system?
LinqToExcel v1.5 used on VS2010 on Windows 7 Pro

Please provide any additional information below.

Original issue reported on code.google.com by joha...@gmail.com on 9 Mar 2011 at 7:53

GoogleCodeExporter commented 8 years ago
You need to add a reference to the System.Linq namespace.

You can do that by adding the following using statement at the top of the file
 'using System.Linq;'

Original comment by paulyo...@gmail.com on 9 Mar 2011 at 2:13

GoogleCodeExporter commented 8 years ago

Original comment by paulyo...@gmail.com on 1 Apr 2011 at 9:49

GoogleCodeExporter commented 8 years ago
I would like to see the full source code on how to convert back to a DataSet 
result.

Original comment by l...@schouw.me on 3 Oct 2011 at 6:25

GoogleCodeExporter commented 8 years ago
Add references Remotion.Data.Linq.dll

Original comment by cesar.am...@gmail.com on 12 Sep 2014 at 1:55

Attachments: