Пример #1
0
 public int Insert(DataChart worker)
 {
     SqlCeCommand Insert = new SqlCeCommand("INSERT INTO Employees (Name, Sale) VALUES (@Name, @Sale)", Employees._connectionString);
     Insert.Parameters.AddWithValue("@Name", worker.key);
     Insert.Parameters.AddWithValue("@Sale", worker.value);
     int returnQuery = Insert.ExecuteNonQuery();
     return returnQuery;
 }
Пример #2
0
 public void FillRandom(int value)
 {
     Random rand = new Random();
     for (int i = 0; i < value; i++)
     {
         string randomName = rand.Next(1, 1000000).ToString();
         float randomSale = rand.Next(1, 100);
         DataChart worker = new DataChart(randomName, randomSale);
         this.Insert(worker);
     }
 }