1

i'm using LinQ . In SQL Server i can get List of existing Views using :

select * from sys.views

Above query returns :

Views_Email_1 
-------------
Views_Email_2

How to do the same using LinQ?

A View is a virtual table based on the result-set of an SQL statement.

2
  • It is not clear what are you asking. What do you mean "get List Views"?
    – torvin
    Oct 5, 2015 at 5:12
  • I want to get Views using LinQ . A View is a virtual table based on the result-set of an SQL statement. you can show me , thanks you very much Oct 5, 2015 at 5:34

1 Answer 1

1

Linq Syntax

    var viewList = from view in DBContext.sys.Views
                   select view.Name;

Method Syntax

var viewList = DBContext.sys.Views.Select(x=>x.Name);
0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.