Search This Blog

Tuesday, July 28, 2009

Java Patterns for MQ Series Clients

here is a great article about Java Patterns for MQ Series Clients.
sample code is there too
http://www.geocities.com/sujitpal/articles/internet/artwb006.html

enjoy
Yaniv T

Friday, July 24, 2009

Convert DataTable to xml the easy way

If you want to convert your data table to xml - here is the function you need:

private string ConvertTableToXml(DataTable table)
{
StringWriter sw = new StringWriter();

table.WriteXml(sw, XmlWriteMode.IgnoreSchema);

return sw.ToString();

}

and if you want to sort your data table before convert it to xml , here is the code snippets

myDatatable.DefaultView.Sort = "MaxPrice DESC";
string mystr = ConvertTableToXml(myDatatable.DefaultView.ToTable());
enjoy
Yaniv