score:1
Accepted answer
string expression;
expression = "namecolumn = 'john'";
datarow[] foundrows;
// use the select method to find all rows matching the filter.
foundrows = table.select(expression);
// print column 0 of each returned row.
for(int i = 0; i < foundrows.length; i ++) {
// list out the retreived values.
console.writeline(foundrows[i]["valuecolumn"]);
}
score:1
var valuename = string.empty;
var query =
from r in dt.asenumerable()
where r.field<string>("value").equals(valuename)
select r.field<string>("assignedvalue");
valuename = "count";
var count = 0;
int.tryparse(query.firstordefault(), out count);
valuename = "channels";
var channels = 0;
int.tryparse(query.firstordefault(), out channels);
valuename = "name";
var name = query.firstordefault();
Source: stackoverflow.com
Related Query
- How to select rows from a DataTable where a Column value is within a List?
- SELECT all data from a table but adding a count field for a particular column value
- Linq query select a particular value from xml
- Select a particular value from datatable-C#
- Select Unique Record from List based on Particular value In Linq
- Linq : select value in a datatable column
- C# LINQ select from where value is not contained in array / list
- Select distinct rows from datatable in Linq
- LINQ Select DataRow from DataTable
- How to select rows from DataTable based on Index / Row Number?
- How to select last value from each run of similar items?
- LINQ Select From DataTable
- skip entire row if particular cell value contains zero in datatable C#
- C# - Remove rows with the same column value from a DataTable
- C# Linq - how to select top 5 rows from a List<string> splitting on the first value
- LinQ query select DataRow from DataTable
- How to select multiple columns from datatable in linq group by?
- How to Select two values from one value
- LINQ to remove duplicate rows from a datatable based on the value of a specific row
- Select First, Last, Min, Max Value based on Time From a List of Objects
- Select rows from one DataTable not in another
- linq to xml: how to select the value from elements
- How to select Columns using where condition from one DataTable to another in C#
- Select Max value from sublist with LINQ
- Select 50 to 100 rows from datatable
- Select values from elements with the particular class name
- Linq use value from select new to calculate another field
- select from a list with field name and field value with linq (similar to select command)
- Get default value from a select in a query
- Get Max from column datatable or Default Value using Linq
More Query from same tag
- Convert String To Int in LINQ
- Convert SQL statement to LINQ in c# with DataAccess (TELERIK OPEN ACCESS ORM)
- How do i use navigation properties correctly EF?
- How do you code a cross join in LINQ?
- why is string IndexOf() acting case-INsensitive?
- linq to sql batch delete
- Converting SQL inner join, group by and order to LINQ
- LINQ GroupBy for multiple Column
- LINQ Where(predicate) vs. FirstOrDefault(predicate)
- How to convert MySQL Group By to C# LINQ Query?
- compare datatables and save unmatched rows in third datatable
- Slow foreach() on a LINQ query - ToList() boosts performance immensely - why is this?
- Appending .Where(..) to a Linq.IQueryable
- How to select distinct based on combination of two fields with LINQ?
- Combine results after join and groupby with DataTable and List<Object>
- Entity Framework - How to improve query with many-to-many relationship
- Sorting and Grouping List data
- Struggling to convert SQL to LINQ
- Selecting object with collection of objects from many-to-many relationship
- Nested vs. Chained Unions
- Dynamically generate Linq Select
- How Can i retrieve date from a hashset that contains date and name using linq or contains?
- Can I compress an if statement using linq in C#?
- DataTable Error - Can't CopyToDataTable()
- Linq query doesn't return a result from object within another object
- Linq, IQueryable get most frequent element object
- Ambiguous IQueryable<T>.Where and IEnumerable<T>.Where on extension method
- MVC3. How to select additional column from joined table and send them all to View?
- Joining of two queries and returning in list format
- LINQ How to make a BETWEEN condition