System.Data Namespace DataTable Class
Sets or retrieves the locale information used to compare strings within the table.
Script |
DataTable.Locale [ = enumValue ] |
enumValue |
A CultureInfo that contains data about the user's machine locale. The default is the DataSet object's CultureInfo ( returned by the Locale property ) to which the DataTable belongs. |
The property is read/write with no default value. If the table does not belong to a DataSet, the default is the current system CultureInfo.
A CultureInfo represents the software preferences of a particular culture or community.When used for string comparisons, the CultureInfo affects sorting, comparisons, and filterings.
The following example sets the CultureInfo using the Locale property and prints the ISO language name.
Private void LocaleDemo ( DataTable myTable ) {
// print the LCID of the present CultureInfo.
Response.Write ( myTable.Locale.LCID );
// create a new CultureInfo for the United Kingdom.
CultureInfo myCultureInfo = new CultureInfo ( "en-gb" );
myTable.Locale = myCultureInfo;
// print the new LCID.
Response.Write ( myTable.Locale.LCID );
}
Private Sub LocaleDemo ( myTable As DataTable )
' print the LCID of the present CultureInfo.
Response.Write ( myTable.Locale.LCID )
' create a new CultureInfo for the United Kingdom.
Dim myCultureInfo As CultureInfo = New CultureInfo ( "en-gb" )
myTable.Locale = myCultureInfo
' print the new LCID.
Response.Write ( myTable.Locale.LCID )
End Sub |
|
C# |
VB |
DataTable Members CultureInfo