Converting output of sql query
Posted
by phenevo
on Stack Overflow
See other posts from Stack Overflow
or by phenevo
Published on 2010-05-10T16:58:39Z
Indexed on
2010/05/10
17:04 UTC
Read the original article
Hit count: 171
Hi,
Let say I have table
Payments
Id int autoincement
Status int
and my query is :
select id, status from payments
but I wanna convert status to enum.
0 is unpaid
1 is paid.
so result should look like:
1 paid
2 unpaid
3 paid
...
I need this conversion because I use
XmlReader reader = cmd.ExecuteXmlReader();
oc.LoadXml("<results></results>");
XmlNode newNode = doc.ReadNode(reader);
while (newNode != null)
{
doc.DocumentElement.AppendChild(newNode);
newNode = doc.ReadNode(reader);
}
and then I save this xml and opening it by excel, and statuses should be friendly for user.
© Stack Overflow or respective owner