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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Chintan RathodRank #516 · 4.8K reputationPosted May 17, 2013, 11:18 AM EDT
======================================
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