score:1
Accepted answer
for (int i = 0; i < dt_allpage.rows.count; i++)
{
model_name = dt_allpage.rows[i][0].tostring();
dataset ds_selecttblram = dal.selecttblram();
datatable dt_selecttblram = ds_selecttblram.tables[0];
datarow row1 = dt_selecttblram.asenumerable().firstordefault(r => r.field<string>("sku").contains(model_name));
foreach (datarow row2 in dt_selecttblram.rows)
{
if (row1 != null)
{
int model_id = (from datarow dr in dt_selecttblram.rows
where (string)dr["sku"] == model_name
select (int)dr["id"]).firstordefault();
}
}
string price = dt_allpage.rows[i][1].tostring();
model_name = dt_allpage.rows[i][0].tostring();
}
Source: stackoverflow.com
Related Query
- How To Compare Table With Datatable or Datable A with Datatable B and update Table by c#
- How do I compare and update 2 lists with huge number of items?
- How to get selected full cell values and compare with database row cell values and update the particular row with new value?
- How to convert data in sql table into datetime and compare with other value in linq
- How to update an element with a List using LINQ and C#
- How do I update a table with LINQ-to-SQL without having to delete all the existing records?
- How to count and sum total of DataTable with LINQ?
- How to combine and update two xml files with LINQ c#
- How to add Month in date time and Compare with another date time in Linq?
- How to compare 2 comma seperated string values and update in existing list at same position?
- I need to compare list with Datatable and filter values using Linq
- Update DataTable from another table with LINQ
- How to compare two lists with multiple objects and set values?
- How do I compare two lists where one list starts with the other, and only return the "overhang" elements?
- Datatable C# - How to get detail record from one table and its associated sub record from another table based on ID
- How to compare with a string array and string
- How do i use linq and select just a Sum of values(field) from a datatable along with a where clause?
- how could i handle this linq query and compare it with and int in an if-statement?
- How to LINQ DataTable with group by and order by to deduplicate data
- Linq how to join tables with a where clause on each table and a count
- How can I extract all Unique / Distinct Rows from a Datatable and save these rows in a new Datatable with same Columns?
- Compare 2 Columns in DataTable to 2 Columns in List and build a new List with certain criteria
- How do I use LINQ to update a datatable with a SqlDataReader?
- Compare datatable and return rows with changes
- How to update all rows of a table with an aggregate value referenced by foreign key on an another table in Entity Framework
- Add column and Update a DataTable with lookup data
- Compare two DataTables with several keys and select the rows that are not present in second table
- How do i obtain foreign table field using string value for fieldname with reflection and entity framework
- how to insert data in 1 table and update another table in a sql database using linq
- LINQ compare lists and update property with values from found object
More Query from same tag
- Is there a LINQ-way to append the same character n-times to a string?
- assigning a position to each item in a list checking if one already exists
- Linq recursive search nodes
- SQL generated by LINQ for logging
- Many to many query from OData feed
- LINQ query to select best sellers
- Retrieving an Entity Object by name - LINQ to Entities, EF 4.0
- C# List intersect with certain item from tuple returned as tuple
- How can I use set operations to delete objects in an entitycollection that match a collection of view models?
- Missing GetTable<TEntity>() in database context
- EF query using extension method inside extension method
- Equality between two enumerables
- Count, order desc and select top 4 values for ASP.NET
- How to Concat String in LINQ SQL WHERE clause?
- Lambda - Linq Convert
- Linq to entities - Formatting results
- Comparing and Finding row value in DataTable C#
- why is this linq query return a boolean and not the first result of the select?
- "error CS0103: the name 'w' does not exist in the current context" in LINQ lambda expression
- Difference between two Lists with non-unique Entries
- Invalid column name. The name was never implemented in the code
- dynamic queries in dapper
- linq query sum products across multiple collections
- Entity Framework Linq to Sql: select from 2 different subqueries based on boolean condition
- How would you write this map-filter chain using LINQ?
- getting Key from collection of KeyValuePairs
- How to put LINQ condition on partial view used by all the views in razor MVC project?
- Equivalence of query and method (lambda) syntax of a Join with Where clause
- Apache Ignite Linq over Sql Failed to resolve java class
- Linq Where not filtering values