Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No DATASET update
Message
De
25/02/2002 11:16:49
 
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Divers
Thread ID:
00622307
Message ID:
00624550
Vues:
16
Hi Rick,

>http://www.west-wind.com/presentations/dotnetwebservices/DotNetWebServicesData.asp

I have a comment about that article:

You mention in the article that DataSets are internally represented as XML and the implication of this is that returning a DataSet from a .NET WebService is like returning XML ... however, that DataSet cannot be easily consumed in anything other than another .NET application. Trying to call that WebService in VFP doesn't work quite so easily ... what actually gets returned is not an XML string, but an object ... and it is a pain to get to the XML from there (it can be done, but it's a PITA). If the WebService takes that DataSet and instead of returning it as is, returns oDS.GetXML() it will then return an XML string, which can easily be consumed by VFP. I recommend that WebServices return this rather than a DataSet.

~~Bonnie



>
>It talks quite a bit about passing datasets over .NET Web Services and things you need to watch out for.
>
>+++ Rick ---
>
>>Hi,
>>
>>Using VS.NET release candidat 2, and XP Pro, and MSSQLserver (Light one).
>>
>>I do have a small WEB services, is main function is to accept one DATASET as parameters, and then update is own copy of the database and table in SQLSERVER.
>>
>>I can see from the NT logevent trace, that I did receive the DATASET with 2 rows (dsdataset), then I open and fill another DATASET (dsRemoteDataset) with 1 row.
>>
>>Then I do merge the first one (dsdataset) with the second dataset (dsRemoteDataset).
>>
>>From the NT logevent trace, I can see just prior to close the dsRemoteDataset that I actually end up with 3 rows, which is ok.
>>
>>But after I close it with the "dsRemoteDataset = Nothing", and go back directly in SQLSERVER, the table still the same with no update. I think I am missing one step related to the way of closing the merge.
>>
>>Can any one help in this behavior??
>>
>>Thanks in advance.
>>
>>Carl
>>
>>Here is the main code of the services,
>>
>> Public Function AcceptUpdate(ByVal dsdataset As DataSet) As Boolean
>>
>>Dim strerror As String
>>Dim dsRemoteDataset As DataSet = New DataSet()
>>Dim strSQL As String
>>Dim strconn As String
>>Dim objDA As SqlClient.SqlDataAdapter
>>strconn = "Initial Catalog=ItemsRemote;Data Source=CBCINC-XP\VSTE;User ID=administrator;Integrated Security=SSPI;"
>>strSQL = "SELECT * FROM Items"
>>Try
>> objDA = New SqlClient.SqlDataAdapter(strSQL, strconn)
>> objDA.Fill(dsRemoteDataset, "Items")
>>
>> logevent("ItemsRemote : items : " & dsRemoteDataset.Tables("Items").Rows.Count.ToString())
>>
>>logevent("ItemsLocale : items : " & dsdataset.Tables("Items").Rows.Count.ToString())
>>
>>dsRemoteDataset.Merge(dsdataset, True)
>>dsRemoteDataset.AcceptChanges()
>>
>>logevent("ItemsRemote : items : After merge : " & dsRemoteDataset.Tables("Items").Rows.Count.ToString())
>>
>>dsRemoteDataset = Nothing
>>Catch objException As Exception
>>
>> 'Display the exception message
>> strerror = objException.Message
>> If Not IsNothing(objException.InnerException) Then
>> strerror += objException.InnerException.Message
>> End If
>> logevent(" Exception error : " & strerror)
>>
>>End Try
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform