Re: Handling special characters in column names in excel



try:
command.CommandText = "INSERT INTO [Apples$]([Fruit Paste 1.1 (Apple)])
VALUES("1")"


"RC" <sricar@xxxxxxxxx> wrote in message
news:1178561905.154209.242770@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

We are using oleDb to write data to excel work***. When creating
columns we are not having any problems with special characters, the
following statement executes fine.

command.CommandText = "CREATE TABLE Apples ([Fruit Paste 1.1 (Apple)]
char(255))";

while inserting a value, the below line is throwing an exception and
it is because of this 1.1..

command.CommandText = "INSERT INTO [Apples$](Fruit Paste 1.1 (Apple))
VALUES("1")"

Are there any alternative ways to get this to work..I did not find
much documentation on this.

Thanks in advance,



.


Loading