Friday, January 2, 2015

Enabling CLR Integration on SQL Server

EXEC sp_CONFIGURE 'show advanced options' , '1';
GO
RECONFIGURE WITH OVERRIDE
GO
 
EXEC sp_CONFIGURE 'clr enabled' , '1'
GO
RECONFIGURE WITH OVERRIDE
GO
If you use with override option, then restart is not required.

Crystal Report: Pad a number with leading zeros up to a fixed length

If table.field is a number

ToText({table.field},"00000000")

or

if is a string


Right("0000"&{MyFieldToPad},8)

Thursday, December 11, 2014

Export Dataset To XML File asp net c#

System.Data.DataSet ds;
//Fill dataset
 
// Get a FileStream object
using (System.IO.StreamWriter xmlDoc = new System.IO.StreamWriter(Server.MapPath("~/writeabledir/xmlDoc.xml"), false))
{
 // Apply the WriteXml method to write an XML document
 ds.WriteXml(xmlDoc);
}