Aaron Aaron - 1 year ago 66
ASP.NET (C#) Question

How to get data from Indexed view?

I have created Indexed view - let's call it PostBank. I keep there Id, CategoryName and UserId. How I get data from PostBank to controller?
Thank You for Your time ;)

SQL command work perfectly, i tested. But I dont know is here possible to use Linq and how?

swe swe
Answer Source

There is no difference to a table. Just do

SELECT * (or Id, CategoryName, UserId) FROM Postbank

From any client, an indexed view is not different to a table or a view. you can use Linq against, you can do anything you can do against any other view. In fact, there really IS no difference from indexed view to "normal" view ITSELF (afaik, if i am wrong, please give advice, someone), the difference is just the index. You also have no difference (from the clients perspective) between an indexed and unindexed table. Here it is the same.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download