To use Yes/No fields with SPQuery,You need to keep in mind some important things.
When you want to query the value for Yes/NO fields in SPQuery,
1. Use value type \"bit\" Not \"Text\
Note: Value type Text work fine with Yes/NO columns in MOSS 2007 but not in WSS.
So, If you are using WSS then you need to use bit not text.
Its always better to use CAML query builder to build a query, and then copy-paste that in SPQuery object.
To use Yes/No columns
if (Convert.ToBoolean(NewsItem["Publish?"]) == true)
{
}
1 comments:
Convert.ToBoolean(itemCollection[0]["Used_In_Stories"].ToString()
Post a Comment