Joining tables from 2 datasets

  • Thread starter Thread starter Peter
  • Start date Start date
Thanks Alexey

But FJC and SJC declared as DataColumn and not strings. I tried calling the routine with my column names in String but returned me
some mismatch errors.

Peter

Hi

I have found this code very useful for me but I can't managed to use the Join. Can someone show me how can I call the code (i.e.
the syntax) especially for the FJC and SJC ? I don't quite understand how to make the call.

http://weblogs.sqlteam.com/davidm/archive/2004/01/20/748.aspx

Thanks
Peter

If you read the comments below post, you will see

Dim dtJoin As DataTable = _Join.Join(dt1, dt2, "id", "id")

Hope this helps
 
Thanks Alexey

But FJC and SJC declared as DataColumn and not strings.   I tried calling the routine with my column names in String but returned me
some mismatch errors.

Peter,

there is an overload of the Join method with different parameter data
types:

public static DataTable Join (DataTable First, DataTable Second,
string FJC, string SJC)
{
return SQLOps.Join(First, Second, new DataColumn[]{First.Columns
[FJC]}, new DataColumn[]{First.Columns[SJC]});
}
 
Thanks guys.. I will play around but will it affect the codes inside if the variable type changed ?

Peter

Thanks Alexey

But FJC and SJC declared as DataColumn and not strings. I tried calling the routine with my column names in String but returned me
some mismatch errors.

Peter,

there is an overload of the Join method with different parameter data
types:

public static DataTable Join (DataTable First, DataTable Second,
string FJC, string SJC)
{
return SQLOps.Join(First, Second, new DataColumn[]{First.Columns
[FJC]}, new DataColumn[]{First.Columns[SJC]});
}
 
Back
Top