private void Import_Aisles() { int rekord = 0; bool existfile = File.Exists(@"C:\Projects\LogXExplorer\Imports\LogX_Aisle.csv"); using (var fileStream = new FileStream(@"C:\Projects\LogXExplorer\Imports\LogX_Aisle.csv", FileMode.Open, FileAccess.Read)) { StreamReader reader = new StreamReader(fileStream); while (!reader.EndOfStream) { string line = reader.ReadLine(); var values = line.Split(';'); if (rekord > 0) { if (values[0] != "") { ProductGroup cus = View.ObjectSpace.CreateObject <ProductGroup>(); cus.Name = values[0]; cus.Save(); } } rekord++; } View.ObjectSpace.CommitChanges(); } }