Indicates whether string comparisons within the table are case-sensitive.
[Visual Basic] Public Property CaseSensitive As Boolean [C#] public bool CaseSensitive {get; set;} [C++] public: __property bool get_CaseSensitive(); public: __property void set_CaseSensitive(bool); [JScript] public function get CaseSensitive() : Boolean; public function set CaseSensitive(Boolean);
true if the comparison is case-sensitive; otherwise, false. The default is set to the parent DataSet object's CaseSensitive property, or false if the DataTable was created independently of a DataSet.
The CaseSensitive property affects string comparisons in sorting, searching, and filtering.
The following example calls the Select method twice on a DataTable. The first time, the CaseSensitive property is set to true, the second, to false.
[Visual Basic]
Private Sub ToggleCaseSensitive() Dim r As DataRow Dim t As DataTable Dim foundRows() As DataRow t = datagrid1.DataGridTable.DataTable t.CaseSensitive = False Console.WriteLine("CaseSensitive = False") ' Presuming the DataTable has a column named 'id' foundRows = t.Select("id = 'abc'") Dim i As Integer ' Print out DataRow values. Presumes row 0 contains the value we're looking for. For i = 0 To UBound(foundRows) Console.WriteLine(foundRows(0)(0)) Next Console.WriteLineDebug("CaseSensitive = True") t.CaseSensitive = True foundRows = t.Select("id = 'abc'") For i = 0 To UBound(foundRows) Console.WriteLine(foundRows(0)(0)) Next End Sub
DataTable Class | DataTable Members | System.Data Namespace | Select