Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Problem
Message
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Titre:
Divers
Thread ID:
01476194
Message ID:
01476213
Vues:
28
>>>>>I'm trying to retrieve an application from my database. I have a Data Context in my app called AppSecurityDataDataContext. Here's my query:
>>>>>
>>>>>
>>>>>{ 
>>>>>    AppSecurityDataDataContext dc = new AppSecurityDataDataContext();
>>>>>    var app = from a in dc._Applications
>>>>>                where a.ApplicationId = ApplicationID
>>>>>                select a;
>>>>>
>>>>>}
>>>>>
>>>>>
>>>>>I'm getting "Could not find an implementation of the query pattern for source type 'System.Data.Linq.Table<AppSecurity._Application>'. 'Select' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?"
>>>>>
>>>>>I have the using statement in my class. This other method works:
>>>>>
>>>>>
>>>>>public static void AddApplication(Application Application)
>>>>>{
>>>>>    _Application app = new _Application
>>>>>    {
>>>>>        ApplicationName = Application.ApplicationName
>>>>>    };
>>>>>
>>>>>    _DataContext._Applications.InsertOnSubmit(app);
>>>>>
>>>>>    try
>>>>>    {
>>>>>        _DataContext.SubmitChanges();
>>>>>    }
>>>>>    catch (Exception e)
>>>>>    { 
>>>>>    }
>>>>>}
>>>>>
>>>>>
>>>>>Anyone see what's wrong here?
>>>>
>>>>==
>>>
>>>umm, huh? What does "==" mean?
>>Not the same as "=":
where a.ApplicationId = ApplicationID
>
>If I remove the Where clause, the comp error still occurs

Then it looks as if it indeed isn't able to reference the System.Linq namespace (Your second example isn't using Linq). Are you sure you have a reference to the System.Core.dll in the project?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform