7 messages in com.mysql.lists.plusplusRe: Using text box data for query input
FromSent OnAttachments
Alex Boyer02 Apr 2008 07:36 
Dave Byington02 Apr 2008 07:45 
Dave Byington02 Apr 2008 07:49 
Dale Stewart02 Apr 2008 08:05 
Alex Boyer02 Apr 2008 08:12 
Warren Young02 Apr 2008 17:02 
Warren Young02 Apr 2008 17:06 
Subject:Re: Using text box data for query input
From:Dave Byington (dave@gmail.com)
Date:04/02/2008 07:49:21 AM
List:com.mysql.lists.plusplus

or maybe something like

query << "SELECT * FROM hpiImages WHERE partNo = '" << textBox1->Text << "' LIMIT 1";

query << "SELECT * FROM hpiImages WHERE partNo = '\"" << textBox1->Text .c_str() << "\"LIMIT 1";

I'm not sure what system your working with but I think it takes a c style string. Try something like

textBox1->Text .c_str()

On 4/2/08, Alex Boyer <abo@hpiracing.com> wrote:

Hey all,

I thought this would be pretty straight forward, but I've tried several different methods, none of which have worked for me. I'm trying to run a query where the search parameters come from a text box.

Code: ======================================= mysqlpp::Connection conn(false);

if(conn.connect("database", "server", "username", "password")) { mysqlpp::Query query = conn.query(); query << "SELECT * FROM hpiImages WHERE partNo = '" << textBox1->Text << "' LIMIT 1"; mysqlpp::StoreQueryResult res = query.store(); mysqlpp::Row row;

if(res) { row = res.at(0); pictureBox1->ImageLocation::set(gcnew String(row.at(2))); } else {

}

} =======================================

Error: error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'System::String ^' (or there is no acceptable conversion)

Sorry if this is a noobish question... It sure seems like it.

--------------------------------------------------------