How would I write the following query using Linq to SQL?
UPDATE [TB_EXAMPLE] SET [COLUMN1] = 1
(My actual goal is more complex than this)
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.
The DataContext class has two query methods, ExecuteCommand, and ExecuteQuery.
The ExecuteQuery method returns LINQ to SQL Entities, so you need to pass a type to it:
However, the ExecuteCommand doesn’t need a type, you’d use this method for your UPDATE query Because you only need a String to write the query, you can use reflection to make a really generic UPDATE method for your DAL.
or