I have a piece of code like this:
DsContactos1.Contactos(0).Contacto = txtContacto.Text
then I pass it to my webservice, but the data isn't updated. I'm sure the dataset leaves to the webservice and I quick watch it to see and the text from the textbox was there. But the data wasn't updated :(((
Suprising is that I tryed like this:
DsContactos1.Contactos(0).Contacto = "test"
And it updated the data. How do I solve this problem

Can't update my data!
Huxwell
Bevor you send the data to the WebService perform the following command:
this.BindingContext[DsContactos1,"Contactos"].EndCurrentEdit();
It worked for me.
L. Lysaght
fantasimus
Good Luck! 0:)
DaveIHS01
JonesEJ20
I was thinking that not. That was the error. It's solved. Thank you!!!
Now I was wondering about the reason for this. I know the canceledit very well but I spended too much time in this that I had forgotten the binding.
I think that when I associated the txtbox.text it wasn't passing by value but by ref, then if the bindingcontext didn't sended a EndCurrentEdit message the the dataset didn't changed the state for the row. I say this because when I debugged the webservice the value was there. Thanks to Uwe Becker you guessed the two problems :)
Coder0xff
Since you said 'test' works, try using 'test' in the textbox as a trial.
Hope this helps.
kasra007
= "xpto test 1234556"
it updates, but if I type it in the textbox it doen't!!!!!! (but I'll check the state tomorrow and I will post here the result)
The maxlenght is of 255, and I type simple things not more than 20 chars!
James Hunter
This is in my presentation layer:
DsContactos1.Contactos(0).Contacto = txtContactos.Text ' My TextBox
DsContactos1.Contactos(0).Tipo = CmbTipos.SelectedValue ' My Combo
Central.WebRestaunet.UpdateTable("Contactos", DsContactos1) ' Central.WebRestaunet is my WebService and 'Contactos' the table
Next, the implementation of the UpdateTable of my Webservice:
<WebMethod(True)> Public Sub UpdateTable(ByVal tabela As String, ByVal ds As DataSet)
Dim tmp As New SqlClient.SqlDataAdapter("select * From " & tabela, Comuns.GetConnection)
Dim tmpi As New SqlClient.SqlCommandBuilder(tmp)
tmp.Update(ds, tabela)
End Sub
My table have the ID row, one Row for the type of Contact (BigInt) and another to the Contact itself (nChar). The reason of being nChar is that my contact type could be and Email, Fax, Phone, IPPhone or Web Page. Initialy it was of nVarChar but in the past (ASP) I had problems with that and I thought it was the problem this time, but it wasn't.
Please note that if I change the Type of Contact in my combo it updates the database. I really don't understand!!!!
Samlazyeye