CAML Query Comparison Operators

  • Contains – Contains a given text value¬†
  • Eq – Equal to
  • Geq – Greater than or equal to
  • Gt – Greater than
  • Leq – Less than or equal to
  • Lt – Less than
  • Neq – Not equal to
  • DateRangesOverlap – Compares dates in recurring events to determine if they overlap
  • IsNotNull – Is not null
  • IsNull¬† – Is null

Export Data Table to Excel

 

Below i express you how to export data table to excel sheet, this should works with SharePoint and .Net Appications

string attachment = “attachment; filename=QueryViewer_Export.xls”;
Response.ClearContent();
Response.AddHeader(“content-disposition”, attachment);
Response.ContentType = “application/vnd.ms-excel”;
string tab = “”;
foreach (DataColumn dc in dt.Columns)
{
Response.Write(tab + dc.ColumnName);
tab = “\t”;
}
Response.Write(“\n”);
int i;
foreach (DataRow dr in dt.Rows)
{
tab = “”;
for (i = 0; i < dt.Columns.Count; i++)
{
Response.Write(tab + dr[i].ToString());
tab = “\t”;
}
Response.Write(“\n”);
}
Response.End();