Read hyphenated value from csv file?
-
I am developing a small application where i upload data from csv into a sql DB. The csv file can have values with hyphens(-). It is possible that the value can be hyphen only. When i read the data from file using a dataadapter, the hyphen is read as '0'. But when i open the CSV using either excel or notepad, the value still is displayed as '-'. Please provide a solution.
-
Answer:
System.Data.OleDb.OleDbDataReader ParseCSVFile = CSVFile.ExecuteReader(); while (ParseCSVFile.Read()) { string[] Line = new string[ParseCSVFile.FieldCount]; for (int i = 0; i < ParseCSVFile.FieldCount; i++) Line[i] = ParseCSVFile.GetValue(i).ToString(); (...)
senthil k at Yahoo! Answers Visit the source
Related Q & A:
- How to merge multiple CSV files into a single CSV file?Best solution by solveyourtech.com
- How to skip columns empty in CSV file when importing into MySQL table using LOAD DATA INFILE?Best solution by Stack Overflow
- How to export CSV file with specific name?Best solution by Stack Overflow
- Рow to find the ordinal variables in a .csv file in python?Best solution by stackoverflow.com
- How to covert csv file to excel and back excel file to csv in python?Best solution by completecampaigns.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.