Forum Moderators: open

Message Too Old, No Replies

Handling Special Characters in database inserts

asp.net csv import program

         

chris_f

11:45 am on Jan 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi All,

I am trying to recreate a function I have written before.

I have written an ASP.net script that reads a csv file and imports the data into the database. However, I remember from my previous experiences that people who used Microsoft Office, often have special characters in the csv. These break the code.

Is there anyway you can think of to deal with these. I am thinking of writting code which ignores the special characters, however, there are millions of them. How would I identify if the character is special or not?

atob.c

korkus2000

1:08 pm on Jan 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are the characters breaking the SQL statement like a ' character or is it the code handling the exchange?

chris_f

2:13 pm on Jan 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Korkus.

Are the characters breaking the SQL statement like a ' character or is it the code handling the exchange?

The SQL statement is in the code. I have taken care of the regular characters like single quotes, double quotes, semi colons etc...

The characters which usually break the code are special characters in word. In fact, quite oftern, it is words version of a single quote that usually breaks the program. The single quotes, if replaced manually in notepad, then go through fine.

Many Thanks
atob.c