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


C# DataSet.Commit方法代码示例

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


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

示例1: CopyRequestedDataSet

        public static void CopyRequestedDataSet(DataSet inDs, DataSet outDs, bool commit)
        {
            foreach (var entry in inDs.Metadata)
                outDs.Metadata[entry.Key] = entry.Value;

            if (!outDs.Variables.Contains(Namings.VarNameLatMax))
                outDs.AddVariable<double>(Namings.VarNameLatMax, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameLatMin))
                outDs.AddVariable<double>(Namings.VarNameLatMin, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameLonMax))
                outDs.AddVariable<double>(Namings.VarNameLonMax, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameLonMin))
                outDs.AddVariable<double>(Namings.VarNameLonMin, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameDayMax))
                outDs.AddVariable<int>(Namings.VarNameDayMax, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameDayMin))
                outDs.AddVariable<int>(Namings.VarNameDayMin, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameHourMax))
                outDs.AddVariable<int>(Namings.VarNameHourMax, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameHourMin))
                outDs.AddVariable<int>(Namings.VarNameHourMin, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameYearMax))
                outDs.AddVariable<int>(Namings.VarNameYearMax, Namings.dimNameCells);
            if (!outDs.Variables.Contains(Namings.VarNameYearMin))
                outDs.AddVariable<int>(Namings.VarNameYearMin, Namings.dimNameCells);

            outDs.Variables[Namings.VarNameDayMax].Append(inDs.Variables[Namings.VarNameDayMax].GetData());
            outDs.Variables[Namings.VarNameDayMin].Append(inDs.Variables[Namings.VarNameDayMin].GetData());
            outDs.Variables[Namings.VarNameHourMax].Append(inDs.Variables[Namings.VarNameHourMax].GetData());
            outDs.Variables[Namings.VarNameHourMin].Append(inDs.Variables[Namings.VarNameHourMin].GetData());
            outDs.Variables[Namings.VarNameYearMax].Append(inDs.Variables[Namings.VarNameYearMax].GetData());
            outDs.Variables[Namings.VarNameYearMin].Append(inDs.Variables[Namings.VarNameYearMin].GetData());
            outDs.Variables[Namings.VarNameLonMax].Append(inDs.Variables[Namings.VarNameLonMax].GetData());
            outDs.Variables[Namings.VarNameLonMin].Append(inDs.Variables[Namings.VarNameLonMin].GetData());
            outDs.Variables[Namings.VarNameLatMax].Append(inDs.Variables[Namings.VarNameLatMax].GetData());
            outDs.Variables[Namings.VarNameLatMin].Append(inDs.Variables[Namings.VarNameLatMin].GetData());

            if (commit)
            {
                outDs.Commit();
            }
        }
开发者ID:modulexcite,项目名称:SDSlite,代码行数:42,代码来源:FetchClimateRequestBuilder.cs

示例2: FillDataSetWithRequest

        public static void FillDataSetWithRequest(DataSet ds, ClimateParameter parameter, double[] latmin, double[] latmax, double[] lonmin, double[] lonmax, int[] starthour, int[] stophour, int[] startday, int[] stopday, int[] startyear, int[] stopyear, FetchingOptions options)
        {
            ds.IsAutocommitEnabled = false;

            ds.Metadata[Namings.metadataNameParameter] = Namings.GetParameterName(parameter);
            ds.Metadata[Namings.metadataNameCoverage] = Namings.GetCoverageName(parameter);
            ds.Metadata[Namings.metadataNameProvenanceHint] = options.FetchClimateProvenanceControlStr;

            if (!ds.Variables.Contains(Namings.VarNameLatMax))
                ds.AddVariable<double>(Namings.VarNameLatMax, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameLatMin))
                ds.AddVariable<double>(Namings.VarNameLatMin, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameLonMax))
                ds.AddVariable<double>(Namings.VarNameLonMax, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameLonMin))
                ds.AddVariable<double>(Namings.VarNameLonMin, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameDayMax))
                ds.AddVariable<int>(Namings.VarNameDayMax, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameDayMin))
                ds.AddVariable<int>(Namings.VarNameDayMin, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameHourMax))
                ds.AddVariable<int>(Namings.VarNameHourMax, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameHourMin))
                ds.AddVariable<int>(Namings.VarNameHourMin, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameYearMax))
                ds.AddVariable<int>(Namings.VarNameYearMax, Namings.dimNameCells);
            if (!ds.Variables.Contains(Namings.VarNameYearMin))
                ds.AddVariable<int>(Namings.VarNameYearMin, Namings.dimNameCells);

            ds.Variables[Namings.VarNameDayMax].Append(stopday);
            ds.Variables[Namings.VarNameDayMin].Append(startday);
            ds.Variables[Namings.VarNameHourMax].Append(stophour);
            ds.Variables[Namings.VarNameHourMin].Append(starthour);
            ds.Variables[Namings.VarNameYearMax].Append(stopyear);
            ds.Variables[Namings.VarNameYearMin].Append(startyear);
            ds.Variables[Namings.VarNameLonMax].Append(lonmax);
            ds.Variables[Namings.VarNameLonMin].Append(lonmin);
            ds.Variables[Namings.VarNameLatMax].Append(latmax);
            ds.Variables[Namings.VarNameLatMin].Append(latmin);

            ds.Commit();
        }
开发者ID:modulexcite,项目名称:SDSlite,代码行数:42,代码来源:FetchClimateRequestBuilder.cs

示例3: FillDataSetWithStatusCheckParams

        public static void FillDataSetWithStatusCheckParams(DataSet ds, int expectedCalculationTime, string hash,bool resendRequest, bool commit)
        {
            ds.Metadata[Namings.restApiMetadataNameExpectedCalculationTime] = expectedCalculationTime;
            ds.Metadata[Namings.restApiMetadataNameHash] = hash;
            ds.Metadata[Namings.restApiMetadataNameResendRequest] = resendRequest;

            if (commit)
                ds.Commit();
        }
开发者ID:modulexcite,项目名称:SDSlite,代码行数:9,代码来源:FetchClimateRequestBuilder.cs


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