title: Comparing values in Data Table in c#
body: <p>I have loaded Two Excel files in two datable now i have to check that the Specific value of column one  of DataTable1 exist in specific cloumn of DataTable 2 or not. I have only one output in rich Text Box which is wrong . What should i do </p>
  
  <p>string connectionStringold = Application.StartupPath + "\Language-Resources-3.0" + ".xls";</p>
  
  <pre><code>        string connstrold = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" + connectionStringold + ";Extended Properties=Excel 8.0";
          OleDbConnection connold = new OleDbConnection(connstrold);
          string strSQLold = "SELECT * FROM [Resources$]";
          OleDbCommand cmdold = new OleDbCommand(strSQLold, connold);
          OleDbDataAdapter daold = new OleDbDataAdapter(cmdold);
  
          DataTable dtold = new DataTable();
          daold.Fill(dtold);
          // dataGridView1.DataSource = dtold;
  
          string connectionString = Application.StartupPath + "\\x_Lang_Res" + ".xls";
          string connstr = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" + connectionString + ";Extended Properties=Excel 8.0";
          OleDbConnection conn = new OleDbConnection(connstr);
          string strSQL = "SELECT * FROM [Chinese$]";
          OleDbCommand cmd = new OleDbCommand(strSQL, conn);
          OleDbDataAdapter da = new OleDbDataAdapter(cmd);
  
          DataTable dt = new DataTable();
          da.Fill(dt);
  
          // dataGridView1.DataSource = dt;
          foreach (DataRow row in dt.Rows)
          {
              string aa = row[1].ToString();
              foreach (DataRow rowold in dtold.Rows)
              {
                  string old = rowold[3].ToString();
                  if (!rowold[3].ToString().Contains(aa))
                  {
                      richTextBox1.Text = aa + "\n\r";
                  }
              }
          }
  </code></pre>