List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:April 3 2008 12:03am
Subject:Re: Using text box data for query input
View as plain text  
Alex Boyer wrote:
>  
>     query << "SELECT * FROM hpiImages WHERE partNo = '" <<
> textBox1->Text << "' LIMIT 1";

MySQL++ doesn't have special support for .NET data types, including the 
one used for text in UI controls, System::String.  It wouldn't be 
terribly difficult to do add such support, but it would create a bit of 
an ifdef mess to turn it off for the majority of other builds where .NET 
isn't available.

So, you need to convert System::String to something Query can ingest 
through its stream interface, and which MySQL will accept on the back 
end.  Yes, there are two conversions here, not just one: .NET data type 
to plain old C data type, and UCS-2 to UTF-8 Unicode format conversion. 
  ToUTF8(), in examples/vstudio/wforms/MainForm.h, does both of these.

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

Yes, it is. :)
Thread
Using text box data for query inputAlex Boyer2 Apr
  • Re: Using text box data for query inputDave Byington2 Apr
    • Re: Using text box data for query inputDave Byington2 Apr
  • Re: Using text box data for query inputWarren Young3 Apr
RE: Using text box data for query inputDale Stewart2 Apr
  • RE: Using text box data for query inputAlex Boyer2 Apr
    • Re: Using text box data for query inputWarren Young3 Apr