0

I have inherited an application written in C# which reads a CSV file and stores the data in database. I've noticed that when a value in the CSV file is this particular string "F1" the application saves it in the DB as "1", omitting the alphabet part of the string.

I am using OleDbDataReader to read the CSV like below. Can anyone see what's causing this?

using (OleDbDataReader reader = command.ExecuteReader())
{
  while (reader.Read())
  {
    currentVar.PortalID = reader.GetValue(16).ToString();
  }
}
JungleJap
  • 41
  • 1
  • 1
  • 3
  • Is there any Exception ./? – Akshay Joy May 13 '13 at 10:27
  • You say you are saving CSV file into DB, but then you show as reading code. How can we know what you do in your import code? –  May 13 '13 at 10:27
  • Show the insert query. I guess you don't put quotes around the input. @AkshayJoy exceptions are not relevant here, the question explains the problem. – CodeCaster May 13 '13 at 10:28

0 Answers0