Poolcorp
asked on
LINQ to DataTable Update Question
Howdy, I am using C# and need a quick run down on how to do something with LINQ, at least I assume it can be done with LINQ. Basically here is what I need to do
I have a data table I have pulled from a server that has some GUIDs in it, I need to match those GUIDs to their respective GUIDS on my side and get the corresponding ID values, then in turn update my DataTable with said ID values.
So in other words I have a datatable that looks something like
Name PhoneNumber GUID ID
Jim 123-456-7890 SDFSG
Mark 234-424-1453 1GDE3
and after I run said update process on it i will have
Name PhoneNumber GUID ID
Jim 123-456-7890 SDFSG 234
Mark 234-424-1453 1GDE3 266
Help would be greatly appreciated. Thanks
I have a data table I have pulled from a server that has some GUIDs in it, I need to match those GUIDs to their respective GUIDS on my side and get the corresponding ID values, then in turn update my DataTable with said ID values.
So in other words I have a datatable that looks something like
Name PhoneNumber GUID ID
Jim 123-456-7890 SDFSG
Mark 234-424-1453 1GDE3
and after I run said update process on it i will have
Name PhoneNumber GUID ID
Jim 123-456-7890 SDFSG 234
Mark 234-424-1453 1GDE3 266
Help would be greatly appreciated. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! Worked like a charm
Not a problem, glad I was able to help. ;=)
If not, you'll need to do your query to match the GUIDs, then just iterate your matches and update the database.
You're query will look something like this, or you could use a join, up to you...
Open in new window