Wednesday, April 13, 2011

serializing + deserializing your object

Excellent article on this. How to serialize your object to xml and get it back.

Monday, April 11, 2011

Linq nullable

How to use linq projection with custom object for nullable parameter

nullable in linq

Excellent article on how to deal with nullable value

telerik excel export style

Good demo to show you how you can change the look and feel

How to change sheet name.

In ExcelMLExportRowCreated  event,

e.Worksheet.Name = "Some Worksheet Name";

Saturday, April 9, 2011

access denied to MQ

Summary is to change the owner to you and give yourself full access on it.

Full details here

Friday, April 8, 2011

WCF

DataContract  -> control input and output

ServiceContract --> control the method

1. Create a interface (Service Contract) to define the methods available
2. Define Data contract if any
3. Create a host (.svc)to implement the interface
4. Client to consume

WCF + MSMQ

WCF + MSMQ example

MSMQ

MessageQueue messageQueue = null;
if (MessageQueue.Exists(@".\Private$\MyTestingQueues"))
{
messageQueue =
new MessageQueue(@".\Private$\MyTestingQueues");
messageQueue.Label = "Testing Queue 1";
Message objMsg = new Message ();
objMsg.Label = "Test Label";
objMsg.Body = "Content 1";
//messageQueue.Send(objMsg);
//TEST
CondoEntity objEntity = new CondoEntity();
objEntity.ListingGUID = Guid.NewGuid();
objEntity.Name = "test";
messageQueue.Formatter = new XmlMessageFormatter(new Type[] { typeof(CondoEntity) });
messageQueue.Send(objEntity);
}
else
{
// Create the Queue
MessageQueue.Create(@".\Private$\MyTestingQueues");
messageQueue = new MessageQueue(@".\Private$\MyTestingQueues");
messageQueue.Label = "Newly Created Queue";
}
messageQueue.Send("First ever Message is sent to MSMQ", "Title");

Friday, April 1, 2011

Selection - Enum

enum ExpenseCategory
{
LocalTravel = 0,
Medical = 1,
Others = 2
}


Load these values with Name into dropdown selection

EnumGetNames(typeof(ExpenseCategory));

Code Generation

This helps you to generate SP and DAL given your data table