public static void Load() { StatClass.jobAssignments.Clear(); using (SQLiteConnection Connect = new SQLiteConnection($@"{StatClass.textFromFile}")) // в строке указывается к какой базе подключаемся { SQLiteCommand command = new SQLiteCommand("SELECT * FROM dbJobAssignments;", Connect); Connect.Open(); SQLiteDataReader reader = command.ExecuteReader(); foreach (DbDataRecord record in reader) { JobAssignment jobAssignment = new JobAssignment(); jobAssignment.JobId = Int32.Parse(record["jobId"].ToString()); jobAssignment.Plase = record["plase"].ToString(); jobAssignment.TechnicId = Int32.Parse(record["technicId"].ToString()); jobAssignment.DateAppointment = record["dateAppointment"].ToString(); jobAssignment.MasterId = Int32.Parse(record["master"].ToString()); jobAssignment.ExecutorId = Int32.Parse(record["executor"].ToString()); StatClass.jobAssignments.Add(jobAssignment); } Connect.Close(); } }
public JobAssignmentForm() { InitializeComponent(); JobAssignment jobAssignments = new JobAssignment(); // jobAssignments.Technic.Model; LoadJob.Load(); DataGreedFill(); }