>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;
>
Did you try:
where p.status == 'A'
"A" is a string... 'A' is a char
http://msdn.microsoft.com/en-us/library/aa691087(VS.71).aspxhttp://msdn.microsoft.com/en-us/library/aa691090(VS.71).aspx