VB.NET: Convert Short() Array into XML in VB.NET

MohitPandit
MohitPandit used Ask the Experts™
on
Hello Folks,

I've a Short() array in VB.NET which I need to convert in XML as I need to pass XML to database.

Could you please provide snippet to convert Short() array to XML?

Best Regards,
Mohit Pandit
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fernando SotoRetired
Distinguished Expert 2017

Commented:
Well that will depend on what the schema of the XML needs to be so that we can direct you on how to create the XML.
Senior Software Engineer
Top Expert 2009
Commented:
If this is the only value to store, it should be easy to convert this array to a CSV string and store the string in database.
YourArray= [1,2,3]
then you could use Join method:
String.Join(",", YourArray)
and store "1,2,3" in database.
Then when read from database you do the reverse operation CSV to array.

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial