Home All Groups Group Topic Archive Search About

Q: select (case insensitive)

Author
27 Sep 2006 2:00 PM
G .Net
Hi

I'm using the Select member of a DataTable in vb.net. In the datatable I
have a field which holds a string. I want to do something like:

Dim name As String = "mike"
Dim rows As DataRow() = dt.Select("[Name] = " & name)

This returns all rows which have "mike" but not "MIKE" or "Mike".

Can anybody tell me how to achieve this?

Thanks in advance

Author
27 Sep 2006 3:15 PM
Tom Shelton
G .Net wrote:
> Hi
>
> I'm using the Select member of a DataTable in vb.net. In the datatable I
> have a field which holds a string. I want to do something like:
>
> Dim name As String = "mike"
> Dim rows As DataRow() = dt.Select("[Name] = " & name)
>
> This returns all rows which have "mike" but not "MIKE" or "Mike".
>
> Can anybody tell me how to achieve this?
>
> Thanks in advance

Set the DataTable.CaseSensitive property to false.

--
Tom Shelton
Author
28 Sep 2006 10:01 AM
G .Net
Hi Tom

Thanks!

Show quoteHide quote
"Tom Shelton" <t**@mtogden.com> wrote in message
news:1159370137.689002.65570@m7g2000cwm.googlegroups.com...
>
> G .Net wrote:
>> Hi
>>
>> I'm using the Select member of a DataTable in vb.net. In the datatable I
>> have a field which holds a string. I want to do something like:
>>
>> Dim name As String = "mike"
>> Dim rows As DataRow() = dt.Select("[Name] = " & name)
>>
>> This returns all rows which have "mike" but not "MIKE" or "Mike".
>>
>> Can anybody tell me how to achieve this?
>>
>> Thanks in advance
>
> Set the DataTable.CaseSensitive property to false.
>
> --
> Tom Shelton
>