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);
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
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
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
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
Thanks Vart for your Patience I’ve finally got it working.
Your help was much appreciated!!