using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
namespace ISNOTNULL
{
class Program
{
static void Main(string[] args)
{
DataTable dtOnsiteInfo = new DataTable();
using (SPSite site = new SPSite("http://serverName/sites/Vijai"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists.TryGetList("Custom");
SPQuery query = new SPQuery();
query.Query = "<Where><IsNotNull><FieldRef Name='Test' /></IsNotNull></Where>";
SPListItemCollection itemColl = list.GetItems(query);
foreach (SPListItem item in itemColl)
{
Console.WriteLine(item["Title"]);
}
Console.ReadLine();
}
}
}
}
}