dbTalk Databases Forums  

ColData conversion failed

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss ColData conversion failed in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ZeeGeek
 
Posts: n/a

Default ColData conversion failed - 08-16-2005 , 10:13 PM






I was trying to convert a ColData to type string but got this compilation e=
rror:

error: conversion from `const mysqlpp::ColData' to non-scalar type
`std::basic_string<char, std::char_traits<char>, std::allocator<char>
Quote:
' requested
then I tried to convert it to Glib::ustring I got the same error. The
codes I used were

mysqlpp::Row row;
while (row =3D result.fetch_row()) {
std::string content =3D row["item"];
std::cout << content << std::endl;
}

--=20
Dell Inspiron 600m
Pentium-M 1.6G
512MB, 60G
ATI 9000 Mobility

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: ColData conversion failed - 08-17-2005 , 02:46 PM






ZeeGeek wrote:
Quote:
std::string content = row["item"];
Say:

std::string content(row["item"]);

instead.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.