如何从Web服务获取数据并存储在表中 [英] How to get data from web service and store in table

查看:71
本文介绍了如何从Web服务获取数据并存储在表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[链接到EXE已删除]



我有网络服务的URL,我想使用MVC或Asp .Net获取数据库表中的数据



所以请给我代码如何存放在桌子上



我尝试过:



[占位符]

[link to EXE removed]

I Have Url of Web Service and i want to Get Data in Database Table using MVC or Asp .Net

so Please Give Me Code How to Store in a table

What I have tried:

[placeholder]

推荐答案

1。在项目中创建一个反映服务返回的类。

2.在数据库中创建一个反映上述类的表

3.在项目中创建方法检索数据

4.将步骤3的响应反序列化到您在步骤1中创建的类中

5.将类实例存储到数据库表中。



显然,除了5行代码之外还有更多内容,但你不能指望我知道你现有的代码;更少写出申请来做这件事。



你需要做的就是能够自己做这些项目。步骤1,2,& 5编程101.一旦完成了连接到服务并解析它的返回。然后将它们连接起来就完成了。
1. Create a class within your project that mirrors what the service returns.
2. Create a table in your database that mirrors the above class
3. Create method in your project to retrieve data
4. Deserialize response from Step 3 into the class you created in step 1
5. Store the class instance into your database table.

Obviously there is more to it than 5 lines of code, but you cannot expect me to know your existing code; much less write out an application to do this.

What you need to do is to be able to do each of these items on your own. Steps 1,2, & 5 are programming 101. Once you have that done work with connecting to the service and parsing it's return. Then tie it all together and you are done.


这篇关于如何从Web服务获取数据并存储在表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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