SelectNodes (Extracting data XML File)

This is a discussion on SelectNodes (Extracting data XML File) within the C++ Programming forums, part of the General Programming Boards category; Vart I have 2003. Was the one you tried: String^ query = String::Concat("/PRODUCTS/FRUIT [CATEGORY= '", FoodCategoryLstBox.SelectedItem.ToString(), "' and ITEM = ...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,450
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,450
    Add S before every C-string like
    S"hello"
    S"world"
    S"my favorite C-string"
    etc
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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!!

Page 2 of 2 FirstFirst 12
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, 01:46 PM
  4. Writing and modifying data in a file
    By Micko in forum C Programming
    Replies: 2
    Last Post: 02-17-2005, 02:42 AM
  5. Editing a data file
    By Strait in forum C++ Programming
    Replies: 7
    Last Post: 02-05-2005, 03:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21