Click here to Skip to main content
15,900,258 members
Home / Discussions / Database
   

Database

 
GeneralRe: search only date Pin
Mycroft Holmes31-Mar-10 12:49
professionalMycroft Holmes31-Mar-10 12:49 
GeneralRe: search only date Pin
Luc Pattyn31-Mar-10 14:56
sitebuilderLuc Pattyn31-Mar-10 14:56 
Questionhow to convert column to row in SQL Server 2005 Pin
Chetan.visodiya30-Mar-10 23:47
Chetan.visodiya30-Mar-10 23:47 
AnswerRe: how to convert column to row in SQL Server 2005 Pin
Mycroft Holmes31-Mar-10 1:28
professionalMycroft Holmes31-Mar-10 1:28 
QuestionBULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T210230-Mar-10 22:29
T210230-Mar-10 22:29 
AnswerRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
Mycroft Holmes30-Mar-10 22:47
professionalMycroft Holmes30-Mar-10 22:47 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T210230-Mar-10 23:22
T210230-Mar-10 23:22 
AnswerRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
R. Giskard Reventlov30-Mar-10 23:11
R. Giskard Reventlov30-Mar-10 23:11 
Firstly, why do you need to remove the apostrophes? Are they not part of the text you are importing or are they superfluous characters that shouldn't have been there?

Either way you might consider opening the csv file in code and then either doubling the apostrophes or removing them, something like (and this is a very simplistic example):

string filePath = "full_path_to_the_csv_file";
string text = File.ReadAllText(filePath);

// Either:
text = text.Replace("'", "''");
// or
text = text.Replace("'", string.Empty);

File.WriteAllText(filePath, text);


You'll need to adjust to suit but it should get you started.
me, me, me

"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven

GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T210230-Mar-10 23:28
T210230-Mar-10 23:28 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
Mycroft Holmes31-Mar-10 1:27
professionalMycroft Holmes31-Mar-10 1:27 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
R. Giskard Reventlov31-Mar-10 5:09
R. Giskard Reventlov31-Mar-10 5:09 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
T21021-Apr-10 3:25
T21021-Apr-10 3:25 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings Pin
R. Giskard Reventlov1-Apr-10 4:04
R. Giskard Reventlov1-Apr-10 4:04 
GeneralRe: BULK INSERT into SQL Server from CSV with apostrophes instead the strings [modified] Pin
T210231-Mar-10 19:07
T210231-Mar-10 19:07 
QuestionDeducting data vs saving it explicitly Pin
Alivemau530-Mar-10 11:11
Alivemau530-Mar-10 11:11 
AnswerRe: Deducting data vs saving it explicitly Pin
PIEBALDconsult30-Mar-10 12:13
mvePIEBALDconsult30-Mar-10 12:13 
AnswerRe: Deducting data vs saving it explicitly Pin
Garth J Lancaster30-Mar-10 15:51
professionalGarth J Lancaster30-Mar-10 15:51 
AnswerRe: Deducting data vs saving it explicitly Pin
PIEBALDconsult30-Mar-10 17:48
mvePIEBALDconsult30-Mar-10 17:48 
AnswerRe: Deducting data vs saving it explicitly Pin
Eddy Vluggen31-Mar-10 0:36
professionalEddy Vluggen31-Mar-10 0:36 
Questionlogin Pin
farokhian30-Mar-10 9:44
farokhian30-Mar-10 9:44 
AnswerRe: login Pin
netJP12L30-Mar-10 10:13
netJP12L30-Mar-10 10:13 
GeneralRe: login Pin
farokhian30-Mar-10 10:42
farokhian30-Mar-10 10:42 
AnswerRe: login Pin
Don Burton30-Mar-10 10:21
Don Burton30-Mar-10 10:21 
Questiontable join Pin
netJP12L30-Mar-10 8:15
netJP12L30-Mar-10 8:15 
AnswerRe: table join Pin
Mycroft Holmes30-Mar-10 22:56
professionalMycroft Holmes30-Mar-10 22:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.