This documentation is archived and is not being maintained.

DataSet.Locale Property

Gets or sets the locale information used to compare strings within the table.

[Visual Basic]
Public Property Locale As CultureInfo
[C#]
public CultureInfo Locale {get; set;}
[C++]
public: __property CultureInfo* get_Locale();
public: __property void set_Locale(CultureInfo*);
[JScript]
public function get Locale() : CultureInfo;
public function set Locale(CultureInfo);

Property Value

A CultureInfo that contains data about the user's machine locale. The default is a null reference (Nothing in Visual Basic).

Remarks

The Locale property specifies the locale for which sorting will apply.

By default, setting the Locale for a DataSet also sets the Locale for each DataTable object in that DataSet to the same value.

Example

[Visual Basic] The following example gets the CultureInfo for a DataSet and prints the DisplayName and EnglishName properties.

[Visual Basic] 
Private Sub GetCultureInfo()
   Dim ci As System.Globalization.CultureInfo
   ci = DataSet1.Locale
   Console.WriteLine(ci.DisplayName, ci.EnglishName)
End Sub

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataSet Class | DataSet Members | System.Data Namespace | CultureInfo

Show: