示例#1
0
        void InsertRecords()
        {
            int      count = 0;
            DateTime start = DateTime.Now;

            try
            {
                db.BeginTransaction();
                for (int i = 0; i < 20000; i++)
                {
                    EmployeeTable tblEmpRec = new EmployeeTable();
                    tblEmpRec.EmpId = "Emp" + i;
                    tblEmpRec.Name  = "Siranjeevi";

                    bool result = db.AddRecord(tblEmpRec);
                    if (result)
                    {
                        count += 1;
                    }
                }
                db.CommitTransaction();
            }
            catch (Exception x)
            {
                db.RollbackTransaction();
            }
            Results.Text = "Elapsed time for storing " + count + " records: " + (DateTime.Now - start);
        }
     void InsertRecords()
     {
         int count = 0;
         DateTime start = DateTime.Now;
         try
         {
        	    db.BeginTransaction();
        	    for (int i=0; i<20000; i++)
             {    		
        	   	    EmployeeTable tblEmpRec = new EmployeeTable();
     		    tblEmpRec.EmpId = "Emp"+i;
     		    tblEmpRec.Name = "Siranjeevi";
     		
     		     bool result = db.AddRecord(tblEmpRec);
        		     if (result) 
                  {
                      count += 1;
                  }        			         		
     		} 
       	    db.CommitTransaction();	
     	}
   	    catch (Exception x) 
         {
 		   db.RollbackTransaction();
 		}
         Results.Text = "Elapsed time for storing " + count + " records: " + (DateTime.Now - start);
     }