locked
Send Request To Aspx And Get Data RRS feed

  • Question

  • Hi.

    Since the phone does not support direct database connection i wonder how i can get my data from
    my MySQL database to the phone, i just want to search and get some various data in the view.


    So is it possible to have a aspx page and then send a request from the phone like "www.mysite.com/aspx.aspx?id=45" and then get the data from that post in my database instead of having the whole database as a xml file.

    Tuesday, September 28, 2010 6:27 PM

Answers

  • Hi pginvest,

    If you want to learn how to create a WCF Service Application which you can later consume
    in a Windows Phone 7 app, add databinding... you can have a look at the following tutorial.

    Creating a Windows Phone 7 Application consuming data using a WCF Service


    http://www.c-sharpcorner.com/UploadFile/UrmimalaPal/1858/Default.aspx 

    it covers 3 basic steps:

    1- Creating the SQL database
    2- Creating the WCF Service Application
    3- Creating the Windows Phone 7 application that consumes the WCF service

    Hope this helps.

    Monday, October 11, 2010 10:39 AM

All replies

  • you will use WCF if you want to use normal SQLClient namespace, sqlconnection and your Silverlight will consume this WCF service to get the results.


    see this video it explain in details how to do this:


    http://www.silverlight.net/learn/videos/silverlight-videos/how-to-consume-wcf-and-aspnet-web-services-in-silverlight/

    you will use WCF if you want to use normal SQLClient namespace, sqlconnection and your Silverlight will consume this WCF service to get the results.

    see this video it explain in details how to do this:

    http://www.silverlight.net/learn/videos/silverlight-videos/how-to-consume-wcf-and-aspnet-web-services-in-silverlight/you will use WCF if you want to use normal SQLClient namespace, sqlconnection and your Silverlight will consume this WCF service to get the results.

    see this video it explain in details how to do this:

    http://www.silverlight.net/learn/videos/silverlight-videos/how-to-consume-wcf-and-aspnet-web-services-in-silverlight/you will use WCF if you want to use normal SQLClient namespace, sqlconnection and your Silverlight will consume this WCF service to get the results.

    see this video it explain in details how to do this:

    http://www.silverlight.net/learn/videos/silverlight-videos/how-to-consume-wcf-and-aspnet-web-services-in-silverlight/you will use WCF if you want to use normal SQLClient namespace, sqlconnection and your Silverlight will consume this WCF service to get the results.

    see this video it explain in details how to do this:

    http://www.silverlight.net/learn/videos/silverlight-videos/how-to-consume-wcf-and-aspnet-web-services-in-silverlight/you will use WCF if you want to use normal SQLClient namespace, sqlconnection and your Silverlight will consume this WCF service to get the results.

    see this video it explain in details how to do this:

    http://www.silverlight.net/learn/videos/silverlight-videos/how-to-consume-wcf-and-aspnet-web-services-in-silverlight/


    Tuesday, September 28, 2010 6:29 PM
  • You can do that. You would use the WebClient class from the phone to submit your request and then on the server side you could retrieve it through the QueryString collection. 

    Saturday, October 2, 2010 9:07 AM
  • Oki.

    Is there any good example on this.

    How should the server side look like and how should the WebClient class look like.


    Havent seen any examples on that.

    Saturday, October 2, 2010 12:48 PM
  • What's your level of familiarity with ASP.Net and Silverlight? Have you ever made a webservice? Do you have any familiarity with ADO.Net?

    Saturday, October 2, 2010 11:53 PM
  • My familiarity with asp.net not so much. But in old asp. And silverlight not so much, but have been make loads of things in WPF.


    This is what i have done with WebClient:

                WebClient adrs = new WebClient();
                adrs.DownloadStringCompleted += new DownloadStringCompletedEventHandler(adrs_DownloadStringCompleted);
                adrs.DownloadStringAsync(new Uri("http://www.msite.se/uninfo.xml?Data=" + username.Text));


    Sunday, October 3, 2010 5:27 AM
  • ASP.Net supports a few higher method ways of accomplishing what you are trying to do. If you create either a new Web Service application or a new WCF service application you'd be able to make a class and define a method that contains the functionality that you want. Let's say you go down the webservice route. Your method would look something like this:

    [WebMethod]
    public void DoSomeFunction(int somParameter) {}

    One the client (Silverlight) side you would be able to right-click on the project and select "Add Service Reference" and enter the URL to your web service application. The methods marked with the [WebMethod] attribute would automatically be discovered. On the client side you would be able to make a call to web service through the method BeginDoSomeFunction(). When the function is don doing it's work an event will be thrown that you can subscribe to. I think this would be a better way to implement this for your purposes.

     

    Monday, October 4, 2010 12:14 AM
  • Is there any tutorial, have googled around but cant find any good.


    Saturday, October 9, 2010 11:30 AM
  • Hi pginvest,

    If you want to learn how to create a WCF Service Application which you can later consume
    in a Windows Phone 7 app, add databinding... you can have a look at the following tutorial.

    Creating a Windows Phone 7 Application consuming data using a WCF Service


    http://www.c-sharpcorner.com/UploadFile/UrmimalaPal/1858/Default.aspx 

    it covers 3 basic steps:

    1- Creating the SQL database
    2- Creating the WCF Service Application
    3- Creating the Windows Phone 7 application that consumes the WCF service

    Hope this helps.

    Monday, October 11, 2010 10:39 AM