I have a website that has some data stored in sql server db. i want to show that data in a gridview in my phone app. is this is possible or not??
If yes please tell me how can i do that.
If yes please tell me how can i do that.
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Chintan RathodPosted May 17, 2013, 3:18 PM
======================================
Following code will call a web service and print output.
======================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.IO;
using System.Diagnostics;
namespace WindowsPhoneApplication1
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
WebClient wc = new WebClient();
wc.DownloadStringAsync(
new Uri("http://my.serviceapp.com/my/webservice"));
wc.DownloadStringCompleted +=
new DownloadStringCompletedEventHandler(
wc_DownloadStringCompleted);
}
void wc_DownloadStringCompleted(object sender,
DownloadStringCompletedEventArgs e)
{
Debug.WriteLine("Web service says: " + e.Result);
}
}
}
Tutorial
- Creating a windows phone 7 application consuming data using wcf service
- How to display data in grid