Json数据进入SQLite数据库 [英] Json data into SQLite Database

查看:422
本文介绍了Json数据进入SQLite数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,我在客户端获取近10000条记录,以Json数据的形式进行ajax调用。现在我想将这些数据存储到SQLite数据库中。

所以我需要相对于此的代码或任何人都可以引用任何链接。这将是非常有帮助的。

I am having a requirement where i fetch nearly 10000 records making ajax call in form of Json data on client side. Now i want to store that data into SQLite database.
So i need the Code relative to this or can anyone refer any link. It will be very helpful.

推荐答案

我知道我在这里很晚,但是当我寻找解决方案时,我刚到这里。



您好这里有两件事。



1)JSON是否保持相同格式,如果是,则使用NewtonSoft JSON.Net,将JSON转换回对象数组,然后手动将它们存储到SQLite数据库。



2)如果JSON格式不能保持相同,那么你需要编写一个解析器,你可以用JSON创建一个对象然后使用SQLite库创建一个表并在那里存储数据。



不幸的是我没有任何代码同样但我正朝这个方向努力,一旦我得到相同的代码就会更新你。



你也可以参考下面的链接,



http://www.dreamincode.net/论坛/主题/ 355466-JSON到sqlit e / [ ^ ]



谢谢

Rushi
I know I am very late here, but I just landed here when I was looking for some solution.

Hi There are two things here.

1) Is that JSON going to remain in same format, if yes then using NewtonSoft JSON.Net, convert that JSON back to object array and then store them manually to SQLite Database.

2) if JSON Format is not going to remain same then you need to write a parser where you can create an object out of JSON and then using SQLite libraries create a table and store data there.

Unfortunately I don't have any code for same but I am working in this direction and will update you once I will get some code for same.

You can also refer below link,

http://www.dreamincode.net/forums/topic/355466-json-to-sqlite/[^]

Thanks
Rushi


这篇关于Json数据进入SQLite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆