haw从Cloudant获取数据(json文档) [英] haw to get data from Cloudant (json document)
本文介绍了haw从Cloudant获取数据(json文档)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我正在使用asp.net,c#
数据库:cloudant
我有JSON格式的cloudant数据,我想从cloudant获取数据,
for exmeple:当我创建一个profil时,数据将保存在cloudant中,在下一页我想转到profil_view.aspx,我可以在那里显示这些数据。
抱歉我的英语不好。
解决方案
在.NET中使用JSON的一种方法是使用数据合约:解析json字符串数组 [ ^ ]。
如果这不是使用Data Contract在.NET中创建的JSON,则仍然可以创建与数据结构匹配的合同。在所有情况下,您都需要对数据格式/结构进行全面描述。
如果这很难做到,请参阅我过去的答案:
如何将对象类型转换为C#类对象类型 [ ^ ],
如何将多级json数据转换为C#对象? [ ^ ]。
您还可以考虑使用开源第三方产品JSON.NET: https://json.codeplex.com [ ^ ]。
-SA
Hello,
I am working with asp.net, c#
database : cloudant
I have data in cloudant in Json Format, I want to get data from cloudant,
for exmeple : when I create a profil, data will saved in cloudant, in the next page I want to go to profil_view.aspx where I can appear this data.
sorry my english is not good.
解决方案
One way of working with JSON in .NET would be using Data Contract: deseralize a json string array[^].
If this is not JSON created in .NET using Data Contract, it still could be possible to create a contract matching the data structure. In all cases, you will need a comprehensive description of the data format/structure.
If this is hard to do, see also my past answers:
How To Convert object type to C# class object type[^],
how to conver multi level json data to C# Object?[^].
You can also consider using open-source 3rd-party product JSON.NET: https://json.codeplex.com[^].
—SA
这篇关于haw从Cloudant获取数据(json文档)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文