|
|
|
start date: Sat, 18 Aug 2007 21:31:58 +0200,
posted on: microsoft.public.dotnet.framework.adonet
back
| Thread Index |
|
1
sam
|
|
2
Nathan Sokalski
|
|
3
sam
|
|
4
Sheng Jiang[MVP] uss
|
Why DataTable.Select("IIF(...)") is refused !
Why using an IIF in a DataTable.Select(IIF("column1=zz",
"column2","column3")); is in invalid context ?
What is the way for using an IIF in a Datatable.Select(...) ?
Thanks for help.
sam
Date:Sat, 18 Aug 2007 21:31:58 +0200
Author:
|
Re: Why DataTable.Select("IIF(...)") is refused !
Try placing the IIF inside a CStr() function, because IIF returns an Object,
you usually need to convert it. Good Luck!
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
"sam" wrote in message
news:%23tV%2315c4HHA.2108@TK2MSFTNGP02.phx.gbl...
> Why using an IIF in a DataTable.Select(IIF("column1=zz",
> "column2","column3")); is in invalid context ?
> What is the way for using an IIF in a Datatable.Select(...) ?
>
> Thanks for help.
>
> sam
>
>
>
Date:Sat, 18 Aug 2007 17:15:41 -0400
Author:
|
Re: Why DataTable.Select("IIF(...)") is refused !
"Nathan Sokalski" a crit dans le message de news:
O4dKtzd4HHA.5984@TK2MSFTNGP04.phx.gbl...
> Try placing the IIF inside a CStr() function, because IIF returns an
> Object, you usually need to convert it. Good Luck!
I have drop the IIF in a Convert.ToString() but the compiler says:
DataTable.Select(Convert.ToString(IIF("name_real="+null,"name_to_use",
"")));
"The name 'identifier' does not exist in the current context "
Someone knows how using IIF in a DaTaTable.Select() ?
Sam
"Nathan Sokalski" a crit dans le message de news:
O4dKtzd4HHA.5984@TK2MSFTNGP04.phx.gbl...
> Try placing the IIF inside a CStr() function, because IIF returns an
> Object, you usually need to convert it. Good Luck!
> --
> Nathan Sokalski
> njsokalski@hotmail.com
> http://www.nathansokalski.com/
>
> "sam" wrote in message
> news:%23tV%2315c4HHA.2108@TK2MSFTNGP02.phx.gbl...
>> Why using an IIF in a DataTable.Select(IIF("column1=zz",
>> "column2","column3")); is in invalid context ?
>> What is the way for using an IIF in a Datatable.Select(...) ?
>>
>> Thanks for help.
>>
>> sam
>>
>>
>>
>
>
Date:Sun, 19 Aug 2007 08:20:56 +0200
Author:
|
Re: Why DataTable.Select("IIF(...)") is refused !
DataTable uses a regular expression to parse your filter. It is likely that
they don't support some SQL functions.
Use a query to populate the data table with filtered results.
--
Sheng Jiang
Microsoft MVP in VC++
"sam" wrote in message
news:#tV#15c4HHA.2108@TK2MSFTNGP02.phx.gbl...
> Why using an IIF in a DataTable.Select(IIF("column1=zz",
> "column2","column3")); is in invalid context ?
> What is the way for using an IIF in a Datatable.Select(...) ?
>
> Thanks for help.
>
> sam
>
>
>
Date:Mon, 20 Aug 2007 12:55:05 -0500
Author:
|
|
|