7 messages in com.mysql.lists.plusplusRE: Using text box data for query input| From | Sent On | Attachments |
|---|---|---|
| Alex Boyer | 02 Apr 2008 07:36 | |
| Dave Byington | 02 Apr 2008 07:45 | |
| Dave Byington | 02 Apr 2008 07:49 | |
| Dale Stewart | 02 Apr 2008 08:05 | |
| Alex Boyer | 02 Apr 2008 08:12 | |
| Warren Young | 02 Apr 2008 17:02 | |
| Warren Young | 02 Apr 2008 17:06 |
| Subject: | RE: Using text box data for query input![]() |
|---|---|
| From: | Dale Stewart (dale...@policetechnologies.com) |
| Date: | 04/02/2008 08:05:02 AM |
| List: | com.mysql.lists.plusplus |
I may be wrong, but I don't think that MySQL++ is set up to work with data types from the .NET CLR. You are using managed C++ here, which is not standard C++. There may be some interoperability that will allow this to work, but you may have fewer hurdles using unmanaged C++ with MFC, rather than using Windows Forms, to implement your GUI. Otherwise, there is probably some conversion from System::String to a standard "C" string that will help you work around this. Unfortunately, I am not well versed enough in .NET to tell you how to go about that. A quick search turns up this article, which may be useful:
http://support.microsoft.com/kb/311259
Thanks, Dale Stewart
-----Original Message----- From: Alex Boyer [mailto:abo...@hpiracing.com] Sent: Wednesday, April 02, 2008 9:46 AM To: plus...@lists.mysql.com Subject: Using text box data for query input
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.
--------------------------------------------------------
Disclaimer: This email is confidential and may be privileged or otherwise protected by work product immunity or other legal rules. It is intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, be advised that you have received this email in error and that any use, disclosure, dissemination, forwarding, printing, saving or copying of any of its contents is strictly prohibited. If you have received this in error please let us know by email reply, then delete this email from your computer system. You may not take any other action in reliance on this email. Any views or opinions presented are solely those of the author and do not necessarily represent those of Hobby Products International, Inc.




