当前位置: 首页>>代码示例>>C#>>正文


C# Table.Update方法代码示例

本文整理汇总了C#中Table.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Table.Update方法的具体用法?C# Table.Update怎么用?C# Table.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


在下文中一共展示了Table.Update方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update_Sem_Where

        public void Update_Sem_Where()
        {
            ITable users = new Table("users");
            users.Update(new
            {
                ativo=true
            });

            string sql_expected = "UPDATE users SET [email protected]_ativo_1";
            Assert.AreEqual(sql_expected, users.ToSql());
        }
开发者ID:georgeribeiro,项目名称:FluentSql,代码行数:11,代码来源:QueryUpdate.cs

示例2: Update_Com_Where

 public void Update_Com_Where()
 {
     var users = new Table("users");
     users.Update(new
     {
         ativo=true,
         salario=500
     })
     .Where(users["idade"] > 20);
     string sql_expected = "UPDATE users SET [email protected]_ativo_1, [email protected]_salario_1 WHERE users.idade > @users_idade_1";
     Assert.AreEqual(sql_expected, users.ToSql());
 }
开发者ID:georgeribeiro,项目名称:FluentSql,代码行数:12,代码来源:QueryUpdate.cs

示例3: UpdateFields

 private static void UpdateFields(Table table)
 {
     foreach (var r in table.Search("*", "", RowInstance.Unique))
     {
         if (!r.IsNull(OldCoda1))
         {
             r.SetInteger(NewCoda2, GetCoda2Value(r.GetInteger(OldCoda1)));
             table.Update(r);
         }
         if (!r.IsNull(OldCoda3))
         {
             try
             {
                 r.SetString(NewCoda4, GetCoda4Value(r.GetString(OldCoda3)));
             }
             catch (Exception ex)
             {
                 _log($"Error retrieving {OldCoda3}: {ex.Message}");
             }
         }
     }
 }
开发者ID:ProvincieGroningen,项目名称:pgpilots,代码行数:22,代码来源:RenameCodaFields.cs

示例4: WriteTable

        private static void WriteTable(BinaryWriter Writer, Table Data)
        {

            /*
             * Write:
             *      Header
             *      Schema
             *      SortKey
             *      Record Collection
             */

            // Update //
            Data.Update();

            // Write header //
            BinarySerializer.WriteRecord(Writer, Data.Header);

            // Write columns //
            BinarySerializer.WriteRecords(Writer, Data.Columns._Cache);

            // Write sort key //
            BinarySerializer.WriteRecord(Writer, Data.SortBy.ToRecord());

            // Write cache //
            BinarySerializer.WriteRecords(Writer, Data.ReferenceTable._Cache);

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:27,代码来源:BinarySerializer.cs

示例5: FlushTable

        public static void FlushTable(Table Data)
        {

            // Update the header //
            Data.Update();

            // Get the size //
            int size = EstimateSize(Data);
            
            // Memory //
            byte[] memory = new byte[size];

            // Create a file stream //
            using (FileStream fs = File.Create(Data.Header.Path))
            {
                int location = BinarySerializer.WriteTableSafe4(memory, 0, Data);
                fs.Write(memory, 0, location);
            }

            // Increment writes //
            _DISK_WRITES++;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:23,代码来源:BinarySerializer.cs

示例6: WriteTableSafe4

        private static int WriteTableSafe4(byte[] Mem, int Location, Table Data)
        {

            /*
             * Write:
             *      Header
             *      Schema
             *      SortKey
             *      Record Collection
             */

            // Update the data //
            Data.Update();

            // Write header //
            Location = BinarySerializer.WriteRecordSafe4(Mem, Location, Data.Header);
            //Console.WriteLine("Header Terminator: {0}", Location);

            // Write columns //
            Location = BinarySerializer.WriteRecordsSafe4(Mem, Location, Data.Columns._Cache);
            //Console.WriteLine("Schema Terminator: {0}", Location);

            // Write sort key //
            Location = BinarySerializer.WriteRecordSafe4(Mem, Location, Data.SortBy.ToRecord());
            //Console.WriteLine("Keys Terminator: {0}", Location);

            // Write cache //
            Location = BinarySerializer.WriteRecordsSafe4(Mem, Location, Data.ReferenceTable._Cache);
            //Console.WriteLine("Data Terminator: {0}", Location);

            return Location;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:33,代码来源:BinarySerializer.cs

示例7: UpdateTable

 public void UpdateTable(Table t)
 {
     t.Update();
     this.SetHashtableValue(t);
 }
开发者ID:TotoCafe,项目名称:TotoCafe,代码行数:5,代码来源:Company.cs


注:本文中的Table.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。