I'm trying to use LINQ to ORacle to get the distinct column values from a table
var query = context.ExecuteQuery("select product_name from dsl_prequal_data where provider_name = 'C1'").Distinct();
foreach (DslPrequalDataN comp in query)
Console.WriteLine(" {0} ", comp.ProductName);
When I try and run this I get an invalidoperationexception because all the columns from the table definition dont exist in the output. How can I get around this? The table is large and has many columns and I want the disctinct value of just this one column name.
LINQ to SQL questions
Why don't you use the following code:
Code: Select all
var query = context.ExecuteQuery("select distinct product_name from dsl_prequal_data where provider_name = 'C1'");
foreach (string comp in query)
Console.WriteLine(" {0} ", comp);