Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LINQ Query help - String vs. Char
Message
De
27/05/2008 15:25:25
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Titre:
LINQ Query help - String vs. Char
Divers
Thread ID:
01319768
Message ID:
01319768
Vues:
58
Just getting started with LINQ here... So, I have a table in my Linq-To-SQL where the 'status' field in the table is of type "char(1)".

when I tried:
 where p.status == "A"
it gave and error, and I have to use this to make it work:
  where p.status.ToString() == "A"
Is this right that I have to use the .ToString() method just to test against a string value? I guess what I mean is, is char(n) not a string? I must be missing something.
            var CustomerList = from a in
                                   (from p in db.job_info
                                    join c in db.customers on p.cust_num equals c.custno
                                    where p.status.ToString() == "A"
                                    orderby c.company
                                    select new {companyname=c.custno + "  -  " + c.company}
                                    ).Distinct()
                               orderby a.companyname
                               select a;
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform