App Development Windows 7手机 [英] App Development windows 7 phone

查看:77
本文介绍了App Development Windows 7手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,对这款游戏有点陌生,但是我想知道如何将数据库链接到应用程序上的按钮的过程或过程是什么?用户应输入参考号,并从我们的数据库中获取报价.任何想法都将不胜感激.

Hi all, bit new to this game but im wondering how or what the process is to link my database to a button on my app? the user should type a reference number, and be brought there quote from our database. any idea''s would be greatly appreciated

推荐答案

不确定我能提供多少帮助,我本人对移动应用程序开发非常陌生.但是,我最近做了一个概念验证应用程序,该应用程序与您尝试做的非常相似.我们希望允许用户从移动设备访问我们数据库中的公司数据.用户输入名称的一部分,我们将在列表框中返回包含搜索字符串的公司列表.然后,他们单击其中之一,我们将返回有关所选公司的一些常规信息.

我使用的一般方法是将所有数据库访问权限放入Windows Communication Foundation(WCF)Web服务中,然后让该Web服务完成所有繁重的工作.然后,移动应用程序也使用WCF调用由Web服务托管的两个功能.

如果您不熟悉WCF Web服务,请尝试在 http://msdn.microsoft.com/en上的教程-us/library/ms734712.aspx [ ^ ].

我将Web服务实现为自托管应用程序,但是您也可以使用IIS托管它.本教程将它作为控制台应用程序进行操作,但是一旦完成该工作,就可以使用Visual Studio服务应用程序模板将其作为Windows服务进行操作.

一旦运行了Web服务,则需要为Windows Phone 7客户端生成一些代理代码.这是通过运行位于c:\ Program Files(x86)\ Microsoft SDK''s \ Silverlight \ v3.0 \ tools中的Silverlight 3服务实用程序完成的.该实用程序的名称为SlSvcUtil.exe.

命令行如下所示:
Not sure how much help I can be, I''m very new to mobile app development myself. However, I recently did a proof-of-concept application very similar to what you are trying to do. We wanted to allow users to access company data on our data base from mobile devices. The user enters part of a name, we return a list of companies containing the search string in a list box. They then click on one of them and we return some general information on the selected company.

The general approach I used was to put all the data base access in a Windows Communication Foundation (WCF) Web Service, and let the web service do all the heavy lifting. The mobile app then calls the two functions hosted by the web service also using WCF.

If you are new to WCF web services, try the tutorial at http://msdn.microsoft.com/en-us/library/ms734712.aspx[^].

I implemented the web service as a self hosting application, but you can also host it using IIS. The tutorial does it as a console application, but once I had that working, I then did it as a Windows Service using the Visual Studio service application template.

Once you have the web service running, you then need to generate some proxy code for your Windows Phone 7 client. This is done by running the Silverlight 3 service utility program located at c:\Program Files (x86)\Microsoft SDK''s\Silverlight\v3.0\tools. The name of the utility is SlSvcUtil.exe.

The command line will look something like this:
SlSvcUtil /language:cs (or vb) /out:MyProxy.cs (or vb) http://localhost:port/ServiceName/Service



然后,将由实用程序生成的MyProxy.cs和ServiceReference.clientconfig添加到项目中.

代理将包含用于调用Web服务功能的代码,但是,Silverlight WCF仅支持aysnch功能.因此,如果您的Web服务具有名为GetQuote的函数,则您的代理代码将具有名为GetQuoteAsynch的函数.然后,您需要为GetQuoteCompleted事件添加一个事件处理程序. Web服务调用的结果将在GetQuoteCompetedEventArgs.Result中返回.

可以将Web服务功能的调用放在单击按钮的事件处理程序中,这听起来像您想要执行的操作.

我不知道这是否是执行所需操作的最佳方法,但就我而言,我需要访问Oracle数据库,也不知道如何在移动设备上安装Oracle客户端软件.由于我们的系统无论如何都是基于Web服务的,因此对我来说这是一个很好的方法.



You then add MyProxy.cs and ServiceReference.clientconfig, both generated by the utility, to your project.

The proxy will contain code to call the web service functions, however, Silverlight WCF only supports aysnch functions. So, if your web service has a function named GetQuote, your proxy code will have a function named GetQuoteAsynch. You then need to add an event handler for the GetQuoteCompleted event. The results of the web service call will be returned in GetQuoteCompetedEventArgs.Result.

The call of the web service function can be put in the button clicked event handler, which sounds like what you want to do.

I have no idea if this is the best way to do what you want, but in my case, I needed to access an Oracle data base and I have no idea how to go about installing the Oracle client software on a mobile device. Since our system is web services based anyhow, this was a good approach for me.


这篇关于App Development Windows 7手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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