使用WCF将应用程序与网站连接 [英] Connecting an app with a website by using WCF

查看:67
本文介绍了使用WCF将应用程序与网站连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个WCF服务来连接我的Android应用程序和我在线网站上的SQL数据库。当我尝试使用Android应用程序从我的数据库中获取数据时我没有错误,没有数据我不知道是否有错误在我的代码中。



我尝试过:



编辑网页.config添加:

< webservices>

< protocols>

< add name =HttpSoap12/>

< add name =HttpSoap/>

< add name =HttpGet/>

< add name = HttpPost/>

I have created a WCF services to connect my android app with my SQL database on online site.when I try to get data from my database using android app I got no error and no data I do not know if there is an error in my code.

What I have tried:

editing web.config by adding this :
<webservices>
<protocols>
<add name="HttpSoap12"/>
<add name="HttpSoap"/>
<add name="HttpGet"/>
<add name="HttpPost"/>

推荐答案

我不是100%肯定这个,但你已经将saveStaff定义为查询

I'm not 100% sure about this but you have saveStaff defined as a query
Dim saveStaff As String = "select Spec from Password where Num = @AndroidNum AND Pass = @AndroidPass"



但你用ExecuteNonQu调用它ery


But you call it with ExecuteNonQuery

querySaveStaff.ExecuteNonQuery()



我不确定这个的净效果。它可能会忽略查询,因为它是一个查询,你说的是ExecuteNonQuery,或者它可能正在运行查询而只是忽略而不返回结果。



HTH ,迈克


I'm not sure the net effect of this. It could be ignoring the query because it's a query and you're saying ExecuteNonQuery, or it could be running the query and just ignoring and not returning the results.

HTH, Mike


这篇关于使用WCF将应用程序与网站连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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