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);
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 = ...
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);
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
If I have eight hours for cutting wood, I spend six sharpening my axe.
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
Add S before every C-string like
S"hello"
S"world"
S"my favorite C-string"
etc
If I have eight hours for cutting wood, I spend six sharpening my axe.
Thanks Vart for your Patience I’ve finally got it working.
Your help was much appreciated!!