none
Normalizing a query results RRS feed

  • Question

  • I created a typed dataset to hold the results of a query. Unfortunately, the DB (which I have only read permissions), isn't normailzed, and I want to normalize when filling the dataset. The sql query will return the following results:

     

     

    Code Snippet

    Name |  Email   | Car

    Joe  |  j@a.com | Honda

    Joe  |  j@a.com | Toyota

    Joe  |  j@a.com | Acura

    Carl |  c@c.com | Honda

    Carl |  c@c.com | Toyota

    Carl |  c@c.com | Acura

     

    In this example, I would have two DataTables:

    Code Snippet

    Contact

    Name | Email

     

    Car

    Name | Car

     

    My first guess is maybe doing attaching TableMappings to the DataAdapter, but I'm not sure how that works. Is there a way to do this with one query and one dataadapter?

    Tuesday, May 20, 2008 1:39 AM

Answers

  • isn't normailzed

     

    What do you mean by not normalized? Could you explain? how can you "normalize" string values? You can normalize two arrays of numeric values in such a way that a common denominator is applied. In doing so at least one member will be identical in both arrays. Normalization means that a "Norm" exists. What is your norm?

    Tuesday, May 20, 2008 4:37 AM
  • As AlexBB already mentionned, "normalization" is probably not the issue here...

    The OP could investigate on the UNIQUE operator...

    SELECT UNIQUE col1, col2 FROM table;
    Tuesday, May 20, 2008 5:16 AM

All replies

  • isn't normailzed

     

    What do you mean by not normalized? Could you explain? how can you "normalize" string values? You can normalize two arrays of numeric values in such a way that a common denominator is applied. In doing so at least one member will be identical in both arrays. Normalization means that a "Norm" exists. What is your norm?

    Tuesday, May 20, 2008 4:37 AM
  • As AlexBB already mentionned, "normalization" is probably not the issue here...

    The OP could investigate on the UNIQUE operator...

    SELECT UNIQUE col1, col2 FROM table;
    Tuesday, May 20, 2008 5:16 AM