PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Rhino.Etl.Tests/LoadTest/BatchUpdateUserNames.cs

http://github.com/ayende/rhino-etl
C# | 26 lines | 19 code | 2 blank | 5 comment | 0 complexity | 926342f7d932ac0d5519524200383075 MD5 | raw file
 1namespace Rhino.Etl.Tests.LoadTest
 2{
 3    using System.Data.SqlClient;
 4    using Core;
 5    using Rhino.Etl.Core.Operations;
 6
 7    public class BatchUpdateUserNames : SqlBatchOperation
 8    {
 9        public BatchUpdateUserNames()
10            : base("test")
11        {
12        }
13
14        /// <summary>
15        /// Prepares the command from the given row
16        /// </summary>
17        /// <param name="row">The row.</param>
18        /// <param name="command">The command.</param>
19        protected override void PrepareCommand(Row row, SqlCommand command)
20        {
21            command.CommandText = "UPDATE Users SET Name = @Name, TestMsg = 'UpperCased' WHERE Id = @Id";
22            command.Parameters.AddWithValue("@Name", row["Name"]);
23            command.Parameters.AddWithValue("@Id", row["Id"]);
24        }
25    }
26}