本文整理汇总了C#中DataSet.CreateDimension方法的典型用法代码示例。如果您正苦于以下问题:C# DataSet.CreateDimension方法的具体用法?C# DataSet.CreateDimension怎么用?C# DataSet.CreateDimension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSet
的用法示例。
在下文中一共展示了DataSet.CreateDimension方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDimension
public void GetDimension()
{
DataSet<int> set = new DataSet<int>("Data");
Dimension dimension = set.CreateDimension("Country");
Dimension result = set.GetDimension("Country");
Assert.IsNotNull(result);
Assert.AreEqual(dimension, result);
Assert.AreEqual("Country", result.Name);
}
示例2: CreateDimension
public void CreateDimension()
{
DataSet<int> set = new DataSet<int>("Data");
Dimension result = set.CreateDimension("Country");
Assert.IsNotNull(result);
Assert.AreEqual("Country", result.Name);
Assert.AreEqual(1, set.Dimensions.Count);
Assert.AreSame(result, set.GetDimension("Country"));
}
示例3: GenerateTuples
private static void GenerateTuples(DataSet<int> set, params int[] nvalues)
{
int k;
string[] dimensions = new string[nvalues.Length];
for (k = 0; k < nvalues.Length; k++)
{
dimensions[k] = string.Format("Dimension{0}", k + 1);
set.CreateDimension(dimensions[k]);
}
var dict = new Dictionary<string, object>();
GenerateValue(set, dimensions, dict, nvalues, 0);
}
示例4: RaiseIfDuplicatedDimension
public void RaiseIfDuplicatedDimension()
{
DataSet<int> set = new DataSet<int>("Data");
set.CreateDimension("Country");
set.CreateDimension("Country");
}
示例5: RaiseIfCreateDimensionAfterAddingData
public void RaiseIfCreateDimensionAfterAddingData()
{
DataSet<int> set = new DataSet<int>("Data");
set.CreateDimension("Country");
set.AddData(
new Dictionary<string, object>
{
{ "Country", "Canada" }
},
100);
set.CreateDimension("Category");
}
示例6: GetDimensions
public void GetDimensions()
{
DataSet<int> set = new DataSet<int>("Data");
set.CreateDimension("Country");
set.CreateDimension("Product");
set.CreateDimension("Category");
var result = set.Dimensions;
Assert.IsNotNull(result);
Assert.AreEqual(3, result.Count);
Assert.IsTrue(result.Any(c => c.Name == "Country"));
Assert.IsTrue(result.Any(c => c.Name == "Product"));
Assert.IsTrue(result.Any(c => c.Name == "Category"));
}