MySql and Parameters (Again...)
Posted by: Diego Guidi
Date: February 03, 2005 02:44AM

I have defined my problem...

<CODE>
// this string in in a a single line
string commandString = "CREATE TABLE ?pTable (ID BIGINT(20) AUTO_INCREMENT NOT NULL, SHAPE POINT NOT NULL, PRIMARY KEY(ID), SPATIAL KEY (SHAPE)) ENGINE=MyISAM AUTO_INCREMENT=1";

MySqlParameter pTable = new MySqlParameter("pTable", MySqlDbType.String);
pTable.Value = this.featureClass; // Value from my program: simply a string

command = new MySqlCommand(commandString, conn);
command.Parameters.Add(pTable);
Console.WriteLine(command.CommandText);
command.ExecuteNonQuery();
</CODE>

Parameter works correctly and ?pTable is modified to 'FeatureClass1' (name of my table), but the <'>characters in my command generates exception!!!
The same command without 'FeatureClass1' (using CREATE TEBLE FeatureClass1 ...) works correctly!

Any suggestions?

Options: ReplyQuote


Subject
Written By
Posted
MySql and Parameters (Again...)
February 03, 2005 02:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.