I'm new to C# ASP.NET, and am working on my first application.
I'm trying to create a linq statment that return an arrary.
I have a table of products. I want to be able to select name, id, and price, for each product where the status == 1.
I am struggling with crating a way to do this. I have only been able to return individual items/columns. I have been stuck on this wayyy to long.
This is what I have so far:
try
{
using (UserDataDataContext db = new UserDataDataContext())
{
return db.mrobProducts.Select(x => x.Name).OrderBy(x => x).ToArray();
}
}
If you look in the screen shot below, you can see I have 2 errors, Select = Type object can not be refered from it's usage ToArray = cant resolve symbol to array