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
This Blog is first of all memos for me!! From time to time I get exposed to new and cool stuff for developers and architects ,most of the time its a solution for a problem or tips or tricks, so, I would like to track my memos and share it with you, it can save your time and nervous, I hope you will enjoy it - by Yaniv Tzanany.
Search This Blog
Tuesday, July 28, 2009
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
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
Subscribe to:
Posts (Atom)