title: ArgumentNullException when creating new datarelation
body: <p>I have two unrelated tables in SQL Server. I want to form a relationship with them via C# so the database diagram in SQL Server has the relationship line etc (the code may have flaws apart from the lack of using statements etc, other than that let me know).</p>
  
  <p>I have this code so far:</p>
  
  <pre><code>   SqlConnection con = new SqlConnection("Data Source=localhost;Initial Catalog=Test;Integrated Security=SSPI");
  
          SqlDataAdapter ad1;
          SqlDataAdapter ad2;
  
          DataSet ds = new DataSet();
          DataRelation dr;
  
  
          ad1 = new SqlDataAdapter("Select * from dept", con);
          ad2 = new SqlDataAdapter("select * from emp", con);
          ad1.Fill(ds, "dept");
          ad2.Fill(ds, "emp");
          DataColumn pk = ds.Tables["dept"].Columns["deptno"];
          DataColumn fk = ds.Tables["emp"].Columns["deptno"];
          dr = new DataRelation("rel", pk, fk, false)
          ds.Relations.Add(dr);
  
          ds.AcceptChanges();
          ad1.Update(ds, "dept");
          ad2.Update(ds, "emp");
  </code></pre>
  
  <p>When I get to this line:</p>
  
  <pre><code>        dr = new DataRelation("rel", pk, fk, false)
  </code></pre>
  
  <p>I get this exception:</p>
  
  <p>'column' argument cannot be null.
  Parameter name: column</p>
  
  <p>Is it possible to actually form relationships in SQL Server this way?</p>
  
  <p>What gives?</p>