Problem with CommandText concatenation - Visual C++



Hi everyone,

I'm trying to assign a command to an OleDbCommand object and
concatenate a string parameter without much success. Here's a basic
idea of what I'm trying to do for my school project against an Access
db.


string sCmd;
OleDbCommand * cmd = new OleDbCommand();


sCmd = "INSERT INTO Books (Title) VALUES (' " + dbFile.Title;
//dbFile.Title is also a string
cmd->CommandText = sCmd;


I then get the following error:
error C2664: 'System::Data::OleDb::OleDbCommand::set_CommandText' :
cannot convert parameter 1 from 'std::string' to 'System::String __gc
*'


Any help would be greatly appreciated.


Thanks!

.



Relevant Pages