---
title: "I have two stored procedures summary1 and summary 2 and get the stored procedures data into two different data table dt1 and dt2 in c#"  
description: "I have two stored procedures summary1 and summary 2 and get the stored procedures data into two different data table dt1 and dt2 in c#"  
author: "Royce Roy"  
published: 2013-05-03  
updated: 2013-05-03  
canonical: https://www.mindstick.com/forum/800/i-have-two-stored-procedures-summary1-and-summary-2-and-get-the-stored-procedures-data-into-two-different-data-table-dt1-and-dt2-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# I have two stored procedures summary1 and summary 2 and get the stored procedures data into two different data table dt1 and dt2 in c#

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!\
I want to get data in [third](https://yourviews.mindstick.com/story/4957/the-significance-of-the-third-eye-in-hinduism-more-than-just-a-symbol) data table dt3 in particular [format](https://www.mindstick.com/forum/162083/how-to-convert-ost-files-into-pst-format) like\
if dt1 table are as --\
name | m1 | m2 | m3 |abc | 12 | 4 | 8 |dcd | 1 | 5 | 7 | dt 2 [table data](https://answers.mindstick.com/qa/114525/how-to-delete-rows-with-reference-table-data) are as -\
name | m1 | m2 | m3 |abc | 5 | 5 | 5 |dcd | 5 | 5 | 5 | both data table have same number of columns with same [column name](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid) .\
i want [result](https://www.mindstick.com/blog/12011/advantages-of-getting-result-oriented-seo-from-an-agency) in dt3 in this format\
name | m1 | m2 | m3 |abc | 12/5 | 4/5 | 8/5 |dcd | 1/5 | 5/5 | 7/5 |and [bind data](https://www.mindstick.com/forum/415/how-to-bind-data-in-windows-phone-7-using-wcf-service) table dt3 data to a gridview.\
Thanks in advance.\

## Replies

### Reply by AVADHESH PATEL

Hi Royec!\
You may use Linq for this,\
var dt3 = from p in dt1.AsEnumerable() join q in dt2.AsEnumerable() on p.Field<string>("name") equals q.Field<string>("name") into UP from q in UP.DefaultIfEmpty() select new { name = p.Field<string>("name"), m1 = p.Field<string>("m1") + "/" + q.Field<string>("m1"), m2 = p.Field<string>("m2") + "/" + q.Field<string>("m2"), m3 = p.Field<string>("m3") + "/" + q.Field<string>("m3") };


---

Original Source: https://www.mindstick.com/forum/800/i-have-two-stored-procedures-summary1-and-summary-2-and-get-the-stored-procedures-data-into-two-different-data-table-dt1-and-dt2-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
