title: How to merge multiple datatables (every datatable return one row) in one row
body: <p>I have multiple data tables : i want to merge them (My <strong>P.K : emp_num</strong>)</p>
  <pre><code>var tblEmp_data = new DataTable();//one row
  var tblEmp_time = new DataTable();//one row
  var tbl_emp_mission = new DataTable();//one row
  
  tblEmp_data = GetEmpInfo(empNum);
  tblEmp_time = GetEmpTime(empNum, start_period, end_period);
  tbl_emp_mission = GetEmpMission(empNum, start_period, end_period);
  
  tblEmp_data.Merge(tblEmp_time, false, MissingSchemaAction.Add);
  tblEmp_data.AcceptChanges();
  tblEmp_data.Merge(tbl_emp_mission, false, MissingSchemaAction.Add);
  tblEmp_data.AcceptChanges();
  </code></pre>
  <hr />
  <p>Now i get the data on multiple rows rather than one row !
  I want the data on one row ? how to do this ?</p>
  <hr />
  <p>Note: i want all the columns allow null except the primary key so i avoid this exception :</p>
  <pre><code>failed to enable constraints. one or more rows contain values violating non-null, unique, or foreign-key constraints 
  </code></pre>
  <hr />
  <h1>Edited:</h1>
  <p>The third table which cause the problem:</p>
  <pre><code>public static DataTable GetEmpMission(int empNum, DateTime start_period, DateTime end_period)
          {
              using (IfxConnection con = new IfxConnection(ConfigurationManager.ConnectionStrings[&quot;tl&quot;].ToString()))
              {
                  DataTable dt = new DataTable();
                  StringBuilder cmdTxt = new StringBuilder();
                  cmdTxt.Append(&quot; SELECT COUNT(emp_num)  &quot;);
                  cmdTxt.Append(&quot; FROM hs_mission WHERE emp_num = ? AND from_date BETWEEN ? AND ?  &quot;);
  
                  using (var myIfxCmd = new IfxCommand(cmdTxt.ToString(), con))
                  {
  
                      myIfxCmd.CommandType = CommandType.Text;
                      if (con.State == ConnectionState.Closed)
                      {
                          con.Open();
                      }
                      myIfxCmd.Parameters.Add(&quot;emp_num&quot;, IfxType.SmallInt);
                      myIfxCmd.Parameters.Add(&quot;start_period&quot;, IfxType.Date);
                      myIfxCmd.Parameters.Add(&quot;end_period&quot;, IfxType.Date);
  
                      myIfxCmd.Parameters[0].Value = ((object)empNum) ?? DBNull.Value;
                      myIfxCmd.Parameters[1].Value = ((object)start_period.Date) ?? DBNull.Value;
                      myIfxCmd.Parameters[2].Value = ((object)end_period.Date) ?? DBNull.Value;
  
                      using (IfxDataReader dr = myIfxCmd.ExecuteReader())
                      {
                          dt.Load(dr);
                          dt.Columns.Add(&quot;emp_num&quot;, typeof(Int32));
                          dt.Rows[0][&quot;emp_num&quot;] = empNum;
                          dt.AcceptChanges();
                      }
  
                  }
                  con.Close();
                  con.Dispose();
                  return dt;
  
  
              }
  
          }
  </code></pre>
  <hr />
  <p>Return data like this :</p>
  <pre><code>column1            emp_num 
  
   0                   6762
  </code></pre>
  <p>and throw exception :</p>
  <pre><code>failed to enable constraints. one or more rows contain values violating non-null, unique, or foreign-key constraints 
  </code></pre>