NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataTable.CaseSensitive

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);

Property Value

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.

Remarks

The CaseSensitive property affects string comparisons in sorting, searching, and filtering.

Example [Visual Basic]

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

See Also

DataTable Class | DataTable Members | System.Data Namespace | Select