title: How can i store results from a Row to a string object using the XDevAPI
body: <p>I am using mysql connector/C++ 8.16, XDevAPI and I want to store data which I get from each row in the table into a string, but I can't. I get different errors.</p>
  
  <p>The following code works :</p>
  
  <pre><code>mysqlx::RowResult rows = mySession.sql("SELECT * FROM testtable").execute();
  
  for (mysqlx::Row row : rows)
  {           
      std::cout &lt;&lt; row[0] &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>but if I want to store <code>row[0]</code> into a string, it's not working.</p>
  
  <pre><code>mysqlx::string s = row[0];//error, Value cannot be converted to string
  </code></pre>
  
  <p>I have already tried to cast it into a <code>mysqlx::string</code> but it's not working, I get the error : </p>
  
  <blockquote>
    <p>"Value cannot be converted to string".</p>
  </blockquote>
  
  <p>I managed to do it with <code>stringstream</code> but it's not really what I want.</p>