Could someone help me translate this Transact-SQL statement to LINQ?
select distinct SUBSTRING ( car# ,1 , PATINDEX ( '%[0123456789]%' , car# )-1 ) from dbo.Purchases
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re using Entity Framework and .NET 4.0, take a look at the
SqlFunctionsclass. It contains definitions for common built-in SQL functions (likePatIndex) that can be used in your LINQ to Entities queries. When used in your queries, these functions are translated into the corresponding SQL function.