WebServices and Datasets

Discussion in 'ASP .Net Web Services' started by JJ, Apr 25, 2005.

  1. JJ

    JJ Guest

    Hi,

    I have a situation where I have a Rich Client Win Form App built in C#
    and I need to transport a dataset across the internet to a webservice in
    asp.net. Database is Sql Server sitting on the same server. Now the problem
    resides in the connection type. He is using a satellite connection to
    internet. I'm wondering since im calling up a webservice to pass a dataset,
    there might be a lag that causes the dataset not to be completely sent. What
    method or design should I use in order to make sure dataset arrives to the
    webservice completely? The dataset will be about 20 to 25 records with 20
    fields per record. Also how can I make sure that the remote database gets
    updated from the dataset? Should I have a method in webservice that takes one
    or two records from dataset and remotely checks database for existence? Does
    anybody have any code examples that basically do what I'm talking about here?

    Thanks,

    JJ
    JJ, Apr 25, 2005
    #1
    1. Advertising

  2. Well I don't think you should have anything to worry about. .Net uses
    the same mechanisms as Internet Explorer does for HTTP. In my mind, if
    there was a problem he would have the same issue if data not being sent
    from IE while making a HTTP Post to soem web site. Data typically gets
    broken down into packets anyways, and I don't think it is often that
    the entire Post or Get is sent in one packet to a web site. So
    basically the lag beyond being a performance issue. Should not be a
    problem technically.

    Now when it comes to pushing up data from a ricj clinet what I would do
    is only send data that has changed such as inserted, updated and
    deleted records. There is a method called GetChanges that will return
    a new DataSet with only the changed rows. This way you only need to
    send what is changed.

    I hope this helps
    Keenan Newton, Apr 25, 2005
    #2
    1. Advertising

  3. JJ

    JJ Guest

    Keenan,

    So you think that passing a diffgram dataset to a webservice would be fine?
    And if I call the GetChanges Method on the dataset that only the changes will
    be shown in the dataset and to pass that to the web service, correct? I
    probably don't need to use a diffgram dataset, just a basic one will be fine.
    Now to make sure the remote database is updated with changes should I
    just create another webmethod that checks the database for inserts/updates
    and relays a message back to the rich client app? If so I would suppose their
    would be a way to create a custom event to fire when database has been
    updated. Should I write a separate method for this custom event to monitor
    the webmethod doing the ins/up's for completion? What design do you think I
    should use here?

    Thanks,

    JJ
    "Keenan Newton" wrote:

    > Well I don't think you should have anything to worry about. .Net uses
    > the same mechanisms as Internet Explorer does for HTTP. In my mind, if
    > there was a problem he would have the same issue if data not being sent
    > from IE while making a HTTP Post to soem web site. Data typically gets
    > broken down into packets anyways, and I don't think it is often that
    > the entire Post or Get is sent in one packet to a web site. So
    > basically the lag beyond being a performance issue. Should not be a
    > problem technically.
    >
    > Now when it comes to pushing up data from a ricj clinet what I would do
    > is only send data that has changed such as inserted, updated and
    > deleted records. There is a method called GetChanges that will return
    > a new DataSet with only the changed rows. This way you only need to
    > send what is changed.
    >
    > I hope this helps
    >
    >
    JJ, Apr 25, 2005
    #3
  4. "So you think that passing a diffgram dataset to a webservice would be
    fine?
    And if I call the GetChanges Method on the dataset that only the
    changes will
    be shown in the dataset and to pass that to the web service, correct? I

    probably don't need to use a diffgram dataset, just a basic one will be
    fine. "

    well ther GetChanges method creates a new dataset object with only rows
    and atbels with changed data.


    "Now to make sure the remote database is updated with changes should I
    just create another webmethod that checks the database for
    inserts/updates
    and relays a message back to the rich client app? If so I would suppose
    their
    would be a way to create a custom event to fire when database has been
    updated. Should I write a separate method for this custom event to
    monitor
    the webmethod doing the ins/up's for completion? What design do you
    think I
    should use here? "

    Thats a good question, this depends on the requirements of your
    application such as location, number of users, service level
    agreements, etc... As for the custom event to fire you will need to
    poll the database, supposedly with Sql 2005 there wiull be an easier
    mechanism to use to determine a change, but remember a web service is
    not really a part of an application. A web service can not notify a
    client a change as occurred unless the client is constantly polling it.
    Same way a web application can't tell a web browser a change as
    occured, the web browser must keep polling for the change. I suggest
    if you are looking to determine if any updates were made to the data.
    That you use a dattime stamp on the rows of data in your tables. Wehn
    you make your first query get a datetime stamp from the databse server
    (unless you know for sure that all the server clocks are synced up).
    Pull that dattime satmp down to the client, now when you make
    anyupds/ins, or just want to see if data has been refreshed. Send the
    datetime stamp up with the webservice call. ON the database, pull any
    records that have a datetime stamp greater then the one sent up from
    the client. Then pull just those records back and merge them with your
    dataset (DataSet.Merge()). If anyone has a better way using web
    services, please chime in.
    Keenan Newton, Apr 26, 2005
    #4
  5. JJ

    jjardine Guest

    "Keenan Newton" <> wrote in message
    news:...
    > "So you think that passing a diffgram dataset to a webservice would be
    > fine?
    > And if I call the GetChanges Method on the dataset that only the
    > changes will
    > be shown in the dataset and to pass that to the web service, correct? I
    >
    > probably don't need to use a diffgram dataset, just a basic one will be
    > fine. "
    >
    > well ther GetChanges method creates a new dataset object with only rows
    > and atbels with changed data.
    >
    >
    > "Now to make sure the remote database is updated with changes should I
    > just create another webmethod that checks the database for
    > inserts/updates
    > and relays a message back to the rich client app? If so I would suppose
    > their
    > would be a way to create a custom event to fire when database has been
    > updated. Should I write a separate method for this custom event to
    > monitor
    > the webmethod doing the ins/up's for completion? What design do you
    > think I
    > should use here? "
    >
    > Thats a good question, this depends on the requirements of your
    > application such as location, number of users, service level
    > agreements, etc... As for the custom event to fire you will need to
    > poll the database, supposedly with Sql 2005 there wiull be an easier
    > mechanism to use to determine a change, but remember a web service is
    > not really a part of an application. A web service can not notify a
    > client a change as occurred unless the client is constantly polling it.
    > Same way a web application can't tell a web browser a change as
    > occured, the web browser must keep polling for the change. I suggest
    > if you are looking to determine if any updates were made to the data.
    > That you use a dattime stamp on the rows of data in your tables. Wehn
    > you make your first query get a datetime stamp from the databse server
    > (unless you know for sure that all the server clocks are synced up).
    > Pull that dattime satmp down to the client, now when you make
    > anyupds/ins, or just want to see if data has been refreshed. Send the
    > datetime stamp up with the webservice call. ON the database, pull any
    > records that have a datetime stamp greater then the one sent up from
    > the client. Then pull just those records back and merge them with your
    > dataset (DataSet.Merge()). If anyone has a better way using web
    > services, please chime in.
    >


    One possible way to handle verifying that the data saved to the database is
    to create a custom object or datatable that contains an ID of each row and a
    status of if the row was saved correctly and return that to the client.
    With this you could then sync the data to the server and then get the
    results immediatly of which records were successful.
    jjardine, Apr 27, 2005
    #5
  6. If I had any issues with a save of data in a row to the database. I
    was use the rowerror property to save the error messaeg too. then
    return the bad row(s) to the client. this way not only do i got the
    error message that occured I also have the bad data. This way I can
    fix the issue and resend it. Again though it really depends on the
    requirements of the application
    Keenan Newton, Apr 27, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. androoo

    webservices and datasets

    androoo, Aug 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    399
  2. news.microsoft.com
    Replies:
    0
    Views:
    429
    news.microsoft.com
    Apr 12, 2006
  3. Francisco Garcia
    Replies:
    2
    Views:
    465
    Fran Garcia
    Apr 13, 2006
  4. news.microsoft.com
    Replies:
    0
    Views:
    184
    news.microsoft.com
    Apr 12, 2006
  5. Francisco Garcia
    Replies:
    3
    Views:
    246
    vincent
    Apr 13, 2006
Loading...

Share This Page