Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > WebServices and Datasets

Reply
Thread Tools

WebServices and Datasets

 
 
JJ
Guest
Posts: n/a
 
      04-25-2005
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
 
Reply With Quote
 
 
 
 
Keenan Newton
Guest
Posts: n/a
 
      04-25-2005
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

 
Reply With Quote
 
 
 
 
JJ
Guest
Posts: n/a
 
      04-25-2005
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
>
>

 
Reply With Quote
 
Keenan Newton
Guest
Posts: n/a
 
      04-26-2005
"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.

 
Reply With Quote
 
jjardine
Guest
Posts: n/a
 
      04-27-2005

"Keenan Newton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> "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.


 
Reply With Quote
 
Keenan Newton
Guest
Posts: n/a
 
      04-27-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? Francisco Garcia ASP .Net Web Services 3 04-13-2006 05:53 PM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? Francisco Garcia ASP .Net 2 04-13-2006 10:41 AM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? news.microsoft.com ASP .Net Web Services 0 04-12-2006 09:07 AM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? news.microsoft.com ASP .Net 0 04-12-2006 09:07 AM
webservices and datasets androoo ASP .Net 3 08-06-2005 04:06 AM



Advertisments