I would like to know how to insert an array into a table in the database. I could use a foreach but I would like something performatic because I will work with a large number of data.
foreach (var item in registros)
{
string CPF = String.Empty;
string nome = String.Empty;
string apto = String.Empty;
CPF = item.Split('|')[0];
nome = item.Split('|')[1];
apto = item.Split('|')[2];
SqlCommand cmd = new SqlCommand("INSERT INTO DATABASE.DBO.TABLE (CPF, NOME, APTO) VALUES (" + CPF + "," + nome + "," + apto + ")");
}