I have come across this problem.I am trying to import data into a database from a csv file.Normally the insert part works,but now I keep getting an error:
Arithmetic overflow error converting int to data type numeric
. The statement has been terminated.It is probably because I have id as the first property,but if I "shift" the array by omitting the id I get the error again,but different:, "Index was outside the bounds of the array."
Student class is simple id,firstName,lastName,salary
values from csv file:

public void Import()
{
var lineNumber = 0; //method for connection
using (SqlConnection conn = DatabaseSingleton.GetInstance())
{
//conn.Open(); //In my project there is my string path to csv file
using (StreamReader reader = new StreamReader(myStringPath))
{
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
if (lineNumber != 0)
{
var values = line.Split(',');
using (command = new SqlCommand("INSERT INTO uzivatel_Barabas VALUES (@id ,@first_Name, @last_Name,@salary) ", conn)) {
command.Parameters.Add(new SqlParameter("@id", Convert.ToInt32(values[0].ToString())));
command.Parameters.Add(new SqlParameter("@first_Name", values[1].ToString()));
command.Parameters.Add(new SqlParameter("@last_Name",values[2].ToString()));
command.Parameters.Add(new SqlParameter("@salary", Convert.ToDouble(values[3].ToString())));
//var sql = "INSERT INTO uzivatel_Barabas VALUES (@first_Name,@last_Name,@salary)";
command.Connection = conn;
command.ExecuteNonQuery();
}
lineNumber++;
}
}
conn.Close();
}
Console.WriteLine("Products Import Complete");
Console.ReadLine();
}
Splitting the lines yourself. there's some pitfalls that the tried and proven existing tools already know.