Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No DATASET update
Message
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Divers
Thread ID:
00622307
Message ID:
00624551
Vues:
15
Thanks Rick, I will definitively look at this today.


>If you haven't done so already, take a look at this article:
>
>http://www.west-wind.com/presentations/dotnetwebservices/DotNetWebServicesData.asp
>
>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
Carl Barbeau.
Analyst Designer office systems.
Carl Barbeau consultant Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform