Visslan
February 1st, 2008, 09:45 AM
Can anyone see what I'm doing wrong I'm getting an ArgumentNullException: Argument column can't be null ?
...
DataSet ds = testDSet( ...);
result.Tables.Add( ds.Tables[0].Copy() );
result.Tables.Add( ds.Tables[1].Copy() );
//here's the code that generates the error!
result.Relations.Add( result.Tables[0].Columns["CustomerNumber"] , result.Tables[1].Columns["CustomerNumber"] );
...
private static DataSet testDSet(...)
{
...
ds.Tables[0].TableName = "test";
...
ds.Tables.Add("Products");
...
DataSet dsProducts = GetProducts(...)
foreach( DataRow dr2 in dsProducts.Tables[0].Rows )
{
ds.Tables["Products"].ImportRow( dr2 );
}
return ds;
}
...
DataSet ds = testDSet( ...);
result.Tables.Add( ds.Tables[0].Copy() );
result.Tables.Add( ds.Tables[1].Copy() );
//here's the code that generates the error!
result.Relations.Add( result.Tables[0].Columns["CustomerNumber"] , result.Tables[1].Columns["CustomerNumber"] );
...
private static DataSet testDSet(...)
{
...
ds.Tables[0].TableName = "test";
...
ds.Tables.Add("Products");
...
DataSet dsProducts = GetProducts(...)
foreach( DataRow dr2 in dsProducts.Tables[0].Rows )
{
ds.Tables["Products"].ImportRow( dr2 );
}
return ds;
}