C# 从windows azure和json web服务检索数据的更好方法

C# 从windows azure和json web服务检索数据的更好方法,c#,json,azure,windows-phone,C#,Json,Azure,Windows Phone,我有一个应用程序,它使用wait从windowsazure检索数据,并将其与从json检索数据一起使用,因此首先我从json获取列表第一行的数据,然后从windowsazure获取下一个列表 private RootObjectDetail _hereRestDetail= null; public RootObjectDetail hereRestDetail { get { return _hereRestDetail; } set { this.SetProperty(re

我有一个应用程序,它使用wait从windowsazure检索数据,并将其与从json检索数据一起使用,因此首先我从json获取列表第一行的数据,然后从windowsazure获取下一个列表

private RootObjectDetail _hereRestDetail= null;
public RootObjectDetail hereRestDetail
{
    get { return _hereRestDetail; }
    set { this.SetProperty(ref this._hereRestDetail, value); }
}
private ObservableCollection<AddressDetail> _hereRestAddressDetail = null;
public ObservableCollection<AddressDetail> hereRestAddressDetail
{
    get { return _hereRestAddressDetail; }
    set { this.SetProperty(ref this._hereRestAddressDetail, value); }
}

private async void UpdateTransportDetail()
{

    try
    {
        isBusy = true;
        isBusyMessage = "Loading web server data...";
        addressItem = await addressTable
            //.Where(placeId = hereRestDetail.placeId )
                    .ToCollectionAsync();
        WebClient client = new WebClient();
        client.DownloadStringCompleted += (s, e) =>
        {
            if (e.Error == null)
            {
                RootObjectDetail result = JsonConvert.DeserializeObject<RootObjectDetail>(e.Result);
                hereRestDetail = result;
                hereRestAddressDetail.Clear();
                hereRestAddressDetail.Insert(0,result.location.address);
                var oc = new ObservableCollection<AddressDetail>();
                foreach (var item in addressItem)
                    hereRestAddressDetail.Add(item);

            }
            else
            {
                isFailed = Visibility.Visible;
                isFailedMessage = "Can't get data from web server, please refresh and make sure your internet data connected";
            }

            isBusy = false;
        };
        client.DownloadStringAsync(new Uri(hrefText + transportDetailURL));

    }
    catch (Exception)
    {
        isFailed = Visibility.Visible;
        isFailedMessage = "Something wrong happen, please refresh";
    }   
}

但有时我会给我一些错误,比如无法连接到数据库,所以也许任何人都可以给我一些方法来提高这个调用的效率?

这里的问题可能是服务器端代码,而不是客户端代码。你能发布服务器代码吗?嗯?我只是使用此代码从服务器获取数据,我没有在我的windows azure服务器中执行任何代码…必须有人编写了一些代码才能在服务器上运行,这就是错误的来源,因此需要修复。