Rory Does Windows Mobile Development - Data Synching With RDA: Part Two

Play Rory Does Windows Mobile Development - Data Synching With RDA: Part Two
Sign in to queue

Description

In this, the second in a two part screencast on data synching, I show you how to use RDA (Remote Data Access) to sync data between a Windows Mobile device and a SQL Server instance.

Also, if you haven't watched Part One, then shame on you. You really, really need to watch Part One before Part Two will make any sense. Just trust me on that Smiley

As always, you can read about my day job here, or visit my blog here.

Screencasts In This Series:

An Introduction To Windows Mobile Development

- Building a Simple Web Browser With the .NET CF 2.0

- A Simple Data Driven Windows Mobile App Using SQL Server Mobile

- Data Synching: Part One

- Data Synching: Part Two

- Windows Mobile 5.0: State Notification API

- Windows Mobile 5.0: Pocket Outlook Object Model

- Windows Mobile 5.0: Camera API

Embed

Download

Download this episode

The Discussion

  • User profile image
    hansolo

    Hey Rory.

     

    I`ve just started coding with C# on pocket pc.Tongue Out
    I`m wondering how to make the IIS that I set up in part one of youre datasync videos to be able to access it from the internett, ex gprs from the pocket pc?

    Regards
    Sven-Tommy (Norway)

  • User profile image
    xmxth001
    How did you link computer to emulator in your presentation?
  • User profile image
    pgannon
    Hello Rory,

    During the video, you test the connection on the device by launching IE and going to:

    http://rory_tablet/SqlMobile/sqlcesa30.dll

    and getting "SQL Server Mobile Server Agent 3.0" to display in the device browser.


    I am attempting to do the same test using the Windows Mobile 5.0 Pocket PC Emulator in VS2005 and pointing to http://mypcname/SqlMobile/sqlcesa30.dll, but I am getting the following message:

    "Cannot connect with the current connection settings. To change your connection settings, tap Settings."

    Will my test even work with the emulator?

    If not, do you have any ideas on how I change my connection settings on my Treo 700w in order for me to connect to my local pc to run this test successfully? Should I use Pocket Controller Professional like you do in the demo?

    I don't have any problems sending apps to the device using ActiveSync 4.2 with a USB cable. In fact, I sent the RdaDemo app to the device, but after clicking the RdaPull menu I get:

    "A request to send data to the computer running IIS has failed. For more information, see HRESULT."

    I'm thinking that if I successfully connect to my pc with the Url above, this error will go away...hopefully.

    Thanks.

    Patrick
  • User profile image
    pgannon

    Here is an update:

    I downloaded the Trial Version of Soti Pocket Controller Pro, and immediately was able to successfully get:

    "SQL Server Mobile Server Agent 3.0" to display in the device browser when browsing to http://mypcname/SqlMobile/sqlcesa30.dll.

    Big Smile:D:D

    I then attempted to do the Pull, but still got the same error:

    "A request to send data to the computer running IIS has failed. For more information, see HRESULT."

    I don't know what HRESULT is or where to find it to start troubleshooting.

    Any help would be appreciated.

    Thank you!

    Patrick

  • User profile image
    pgannon
    Another update:

    "A request to send data to the computer running IIS has failed. For more information, see HRESULT."

    This message appeared because I didn't have an open Internet connection on my Treo. I can open the connection by launching IE on the device or by going to Start - Settings - Connections.

    I just need to find out how to open the connection programmatically with the C# app.

    Thanks.

    Patrick
  • User profile image
    rready1
    Your demo was great! but Im not able to add a row to the table the rowguid does not populate even though I put the code in the Load event.  any suggestions??
  • User profile image
    avida78
    Hi Rory,

    First of all I would like to thank you for the great lessons Smiley
    I'm trying to monitor the Battery state and time state in my program.
    the battery issue is working but in the label that soppuse to display the time I see "System.byte[]" Sad
    I'm adding the code I wrote if you can tell me what I'm doing wrong I'll be very grateful...

    public frmWelcome()

    {

    InitializeComponent();

    lblBattery.Text = "Battery : " + SystemState.GetValue(SystemProperty.PowerBatteryStrength).ToString() + "%";

    OwnerBettryState = new SystemState(SystemProperty.PowerBatteryStrength);

    OwnerBettryState.Changed += new ChangeEventHandler(OwnerBettryState_Changed);

    lblTime.Text = SystemState.GetValue(SystemProperty.Time).ToString();

    OwnerTimeState = new SystemState(SystemProperty.Time);

    OwnerTimeState.Changed += new ChangeEventHandler(OwnerTimeState_Changed);

    }

    void OwnerTimeState_Changed(object sender, ChangeEventArgs args)

    {

    lblTime.Text = args.NewValue.ToString();

    //throw new Exception("The method or operation is not implemented.");

    }

    void OwnerBettryState_Changed(object sender, ChangeEventArgs args)

    {

    lblBattery.Text = "Battery :" + args.NewValue.ToString();

    //throw new Exception("The method or operation is not implemented.");

    }


    Thanks very much in advande Smiley

  • User profile image
    Aneesh
    HI ,
     Is there a link to download these video?
    That would be eally great if we have an option to download two parts of RDA sync video!
     
  • User profile image
    Aneesh
    HI ,
     Is there a link to download these video?
    That would be eally great if we have an option to download two parts of RDA sync video!
  • User profile image
    imomin
    Hi! I have t-mobile wing (WM6) and I am connecting to the internet via USB cable to the computer where I am running
    http://localhost/sqlMobile/sqlcesa30.dll
     on IIS and "MobileDemo" database on SQL2005 server.

    Everytime time try to pull data I get following error: "A request to send data to the computer running IIS has failed. For more information, see HRESULT."

    I am able to connect to sqlcesa30.dll using IE but get above error on pull.

    What is it that I am doing wrong or what have I missed.

    -Regards
    Imtiyaz Momin
    http://gps.imomin.com/tracker.cfm?userID=1
  • User profile image
    imomin

    This is a solution which I found online and it works for me.

     

    1. Click Start, click Run, type firewall.cpl, and then click OK.
    2. In the Windows Firewall dialog box, click the Advanced tab.
    3. In the Network Connection Settings box, click the connection that your computer uses, and then click Settings.
    4. In the Advanced Settings dialog box, click Web Server (HTTP), and then click Secure Web Server (HTTPS).

    Note For additional information about when you must allow users to access the Secure Web Server (HTTPS) on your computer, see the "More Information" section.
    5. Click OK.
    6. In the Windows Firewall dialog box, click OK.

    OR
    Turn off the Firewall while you are testing.

    But, now I am getting "failure to open SQL Server with given connect string. [ connect string = Provider=SQLOLEBD.1;Data Source=localhost;Presist Security Info=True;User ID=MobileUser;Password=password;Initial Catalog=MobileDemo]
  • User profile image
    imomin
    Hi! I have security question. Do you guys think there is hude security flaw where we hardcode connection string in the app which can be easily extracted using string viewer.
    Also, is there a change where "bad query" can be send through puch function?

    There are lots of bad people out there....[6]
  • User profile image
    bywaterr
    Hi Rory,

    I have enjoyed your videos so far and thank you for your effort putting them together.

    I have a problem with Data Synching Part two.  I have done Part one and it works.  After typing in the code for Part Two I connect to my PDA but the error message I get is Failure to open SQL Server with given connect string [connect string = Provider = SQLOLEDB.1; Data Source=localhost; Persist Security Info = True; User ID=MobileUser; Password=password; Initial Catalog=MobileDemo].  I was wondering whether you could send me the code for this complete return.  Or suggest what I might have done wrong.  I have double checked the MobileUser password and everything looks OK.  I created the database as per video.

    Thank you.
    Roy
  • User profile image
    RamblingGeek​UK
    imomin wrote:
    Hi! I have t-mobile wing (WM6) and I am connecting to the internet via USB cable to the computer where I am running
    http://localhost/sqlMobile/sqlcesa30.dll
     on IIS and "MobileDemo" database on SQL2005 server.

    Everytime time try to pull data I get following error: "A request to send data to the computer running IIS has failed. For more information, see HRESULT."

    I am able to connect to sqlcesa30.dll using IE but get above error on pull.

    What is it that I am doing wrong or what have I missed.

    -Regards
    Imtiyaz Momin
    http://gps.imomin.com/tracker.cfm?userID=1


    I've be playing around with this and have mine fully working. 

    I was getting the same error as you ensure you can browse first, if connected by USB, once connected  I had to click on connect without setting up device, then I could browse via USB ok.

    I also noticed that when you disconnected the usb you have to browse which causes the phone to reconnect via GPRS/3g/HSDPA.

  • User profile image
    RamblingGeek​UK
    bywaterr wrote:
    Hi Rory,

    I have enjoyed your videos so far and thank you for your effort putting them together.

    I have a problem with Data Synching Part two.  I have done Part one and it works.  After typing in the code for Part Two I connect to my PDA but the error message I get is Failure to open SQL Server with given connect string [connect string = Provider = SQLOLEDB.1; Data Source=localhost; Persist Security Info = True; User ID=MobileUser; Password=password; Initial Catalog=MobileDemo].  I was wondering whether you could send me the code for this complete return.  Or suggest what I might have done wrong.  I have double checked the MobileUser password and everything looks OK.  I created the database as per video.

    Thank you.
    Roy


    I had to setting the configuration of SQL Server to SQL auth, mine was set to Windows Auth changed it and this went away.

    In SQL Managment, select server name > right click > propeties > security, select SQL Server and Windows Auth mode on the right hand side.

    Rory does mention his video but he doesn't show it.... as he said patience [A].
  • User profile image
    RamblingGeek​UK

    Rory this rocks!

    Bit late coming to the party but I'm soooo glad that you did these videos!

    For some reason when I dispose the RDA object after the pull mobile mobile restarts, rem it out and its fine.....

    Big Smile

    Any suggestions?

  • User profile image
    Website For Mobiles

    You can simply create your own mobile websites. Well, We would like to tell you that a mobile friendly website also possesses various advantages. for more information Well, it is a fact that every mobile websites is well enhanced with store locators.

  • User profile image
    dave

    Hi Rory,Thank you for the two videos about RDA.If the IIS server and SQL Server database are on different boxes (not on same machine), how to do set up or specify URL for sqlcesa.dll and database?I am develop a mobile app but IIS computer and SQL server computer are not located on same machine.Please help.

Add Your 2 Cents