Joining tables from 2 datasets

Discussion in 'ASP .Net' started by Peter, Jun 6, 2009.

  1. Peter

    Peter Guest

    Peter, Jun 6, 2009
    #1
    1. Advertising

  2. On Jun 6, 5:23 pm, "Peter" <> wrote:
    > 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
     
    Alexey Smirnov, Jun 6, 2009
    #2
    1. Advertising

  3. Peter

    Peter Guest

    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

    "Alexey Smirnov" <> wrote in message
    news:...
    On Jun 6, 5:23 pm, "Peter" <> wrote:
    > 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
     
    Peter, Jun 7, 2009
    #3
  4. On Jun 7, 6:27 pm, "Peter" <> wrote:
    > 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]});
    }
     
    Alexey Smirnov, Jun 7, 2009
    #4
  5. Peter

    Peter Guest

    Thanks guys.. I will play around but will it affect the codes inside if the variable type changed ?

    Peter

    "Alexey Smirnov" <> wrote in message
    news:...
    On Jun 7, 6:27 pm, "Peter" <> wrote:
    > 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]});
    }
     
    Peter, Jun 8, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWlrZSBNb29yZQ==?=

    joining tables or view

    =?Utf-8?B?TWlrZSBNb29yZQ==?=, Jul 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    351
    =?Utf-8?B?TWlrZSBNb29yZQ==?=
    Jul 7, 2005
  2. news.microsoft.com
    Replies:
    0
    Views:
    439
    news.microsoft.com
    Apr 12, 2006
  3. Francisco Garcia
    Replies:
    2
    Views:
    471
    Fran Garcia
    Apr 13, 2006
  4. news.microsoft.com
    Replies:
    0
    Views:
    187
    news.microsoft.com
    Apr 12, 2006
  5. Francisco Garcia
    Replies:
    3
    Views:
    251
    vincent
    Apr 13, 2006
Loading...

Share This Page