Results 1 to 6 of 6

Thread: [HELP!]Rows into Colums? [beginner]

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    Poland
    Posts
    11

    [HELP!]Rows into Colums? [beginner]

    Hi, I got huge problem with trasformining rows from one table in DataBase into Colums in program(dataset). To make my self clear, I will illustrate situation on example:
    First table:
    File_ID fild_type_ID value
    00001 1 Peter
    00001 3 M
    00002 1 Jane
    00002 3 F
    ….
    Result table:

    name sex …
    Peter M
    Jane F
    ….

    I was traing to do many dataadapters and join into one dataset, but i couldn't, because error occured: "Can't create multiple table set with contains tables with same name"! I can't change structure of database!!

    Please help!!

    PS I use VS .NET 2003 and Ms SQL Server 2000

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    Poland
    Posts
    11

    Re: [HELP!]Rows into Colums? [beginner]

    I haven't got two tables with same name, but I use same table two times.

    THX & Please Help

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    Poland
    Posts
    11

    Re: [HELP!]Rows into Colums? [beginner]

    Hmmm, so I will try to explain again. As i said before, I got in database a table with structure:
    Arch_table
    File_ID fild_type_ID value
    00001 1 Peter
    00001 3 M
    00001 5 blue
    00002 1 Jane
    00002 3 F
    00002 5 red

    I would like my program to dispaly some informations form Arch_table (for example Name and sex) in reverse way:
    Name (fild_type_ID=1) | Sex (fild_type_Id=3)
    Peter | M
    Jane | F

    This error, what I had written before, occured when I had tried to make a dataset from two dataadapters which were connected to the same table in dataset. ( 1st dataadapter colleted information about name and File_ID, 2nd about sex and File_ID). I can't give code, because I was trying to do that Visual programing.

    I hope that this time i make my self clearer.

    THX very much for help!!

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    Poland
    Posts
    11

    Re: [HELP!]Rows into Colums? [beginner]

    Many thx for help and sorry than i haven't replay earlier.

    I you example ( thx again) you got table with structure:
    name sex ....

    I got table where single data is one row:
    File_ID |fild_type_ID | value
    1 row : 00001 | 1 | Peter
    2 row : 00001 | 3 | M
    ...

    I don't know not how to display data, but how to tranform and display a data of one kind (same fild_type_ID) in colums. In other words, how to make a table with colums: Name (fild_type_ID=1), Sex (fild_type_ID=3) and so one. Every row will represent data from one File_ID. ( I head that it was called cross join tables??)

    Thx and Kind Regards

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    Poland
    Posts
    11

    Re: [HELP!]Rows into Colums? [beginner]

    I assure that is base on real situation and the table have a thousands records, but i don't want to do column for every record, but for one type (specyficated by fild_type_ID). Moreover let's say that not for all types (I was thinking that if I say all will be easier),but for some which i know fild_type_ID, in the example there will be 1,3,5. Result table have in row a value for given fild_type_ID for single file_ID.
    I draw a example ( sorry for form, but i only used paint), I hope that it will make every thing clear.

    THX & Kind Regards
    Attached Images Attached Images  

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Location
    Poland
    Posts
    11

    Re: [HELP!]Rows into Colums? [beginner]

    PS When i saw my previous post I thought that it looks realy hopeless, sorry again for quality of this picture.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width