Thread: SelectNodes (Extracting data XML File)

  1. #16
    Registered User
    Join Date
    Jan 2007
    Posts
    9
    Vart I have 2003.

    Was the one you tried:

    String^ query = String::Concat("/PRODUCTS/FRUIT [CATEGORY= '", FoodCategoryLstBox.SelectedItem.ToString(), "' and ITEM = '" , ItemcmbBox.SelectedItem.ToString() , "']/ PRICE ");

    doc.SelectNodes(query);

  2. #17
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Yes... the first line... haven't build the xml-dom, so didn't passed the string to the function. But string construction compiled without warnings
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #18
    Registered User
    Join Date
    Jan 2007
    Posts
    9
    Ok I put the S after the opening bracket (see code below)

    String^ query = String::Concat(S"/PRODUCTS/FRUIT [CATEGORY= '", FoodCategoryLstBox.SelectedItem.ToString(), "' and ITEM = '" , ItemcmbBox.SelectedItem.ToString() , "']/ PRICE ");

    And instead of giving me the following error message:

    error C2665: 'System::String::Concat' : none of the 9 overloads can convert parameter 1 from type 'const char [30]'

    I get the error:

    C2665: 'System::String::Concat' : none of the 9 overloads can convert parameter 3 from type 'const char [16]'.

    So it looks like that by using S after the bracket it as helped a bit but I’m not sure where else I need to add the ' S ' to the statement to get to work fully?

    Thanks

  4. #19
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Add S before every C-string like
    S"hello"
    S"world"
    S"my favorite C-string"
    etc
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #20
    Registered User
    Join Date
    Jan 2007
    Posts
    9
    Thanks Vart for your Patience I’ve finally got it working.

    Your help was much appreciated!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. Writing and modifying data in a file
    By Micko in forum C Programming
    Replies: 2
    Last Post: 02-17-2005, 03:42 AM
  5. Editing a data file
    By Strait in forum C++ Programming
    Replies: 7
    Last Post: 02-05-2005, 04:21 PM