Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LINQ Query help - String vs. Char
Message
From
27/05/2008 15:25:25
 
 
To
All
General information
Forum:
ASP.NET
Category:
LINQ
Title:
LINQ Query help - String vs. Char
Miscellaneous
Thread ID:
01319768
Message ID:
01319768
Views:
57
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;
Next
Reply
Map
View

Click here to load this message in the networking platform