DataSet.Locale DataSet.Locale DataSet.Locale DataSet.Locale Property

定义

获取或设置用于比较表中字符串的区域设置信息。Gets or sets the locale information used to compare strings within the table.

public:
 property System::Globalization::CultureInfo ^ Locale { System::Globalization::CultureInfo ^ get(); void set(System::Globalization::CultureInfo ^ value); };
[System.Data.DataSysDescription("DataSetLocaleDescr")]
public System.Globalization.CultureInfo Locale { get; set; }
member this.Locale : System.Globalization.CultureInfo with get, set
Public Property Locale As CultureInfo

属性值

一个 CultureInfo,它包含有关用户计算机区域设置的数据。A CultureInfo that contains data about the user's machine locale. 默认值为 nullThe default is null.

示例

CultureInfo下面的示例获取DataSet的,并打印DisplayNameEnglishName属性。The following example gets the CultureInfo for a DataSet and prints the DisplayName and EnglishName properties.

Private Sub GetCultureInfo()
   Dim culture As System.Globalization.CultureInfo
   culture = DataSet1.Locale
   Console.WriteLine(culture.DisplayName, culture.EnglishName)
End Sub

注解

Locale属性指定要应用排序的区域设置。The Locale property specifies the locale for which sorting applies.

默认情况下,将Locale设置DataSet为,还会Locale DataSet将中DataTable的每个对象的设置为相同的值。By default, setting the Locale for a DataSet also sets the Locale for each DataTable object in that DataSet to the same value.

备注

在包含表达式的InvariantCulture列中,使用。In columns that contain expressions, the InvariantCulture is used. CurrentCulture忽略。The CurrentCulture is ignored.

适用于

另请参阅