Groups | Blog | Home
all groups > vb.net controls > june 2004 >

vb.net controls : Update From Label No Good


Justin Emlay
6/22/2004 4:35:22 PM
Private Sub lblUpdateEmployees_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles lblUpdateEmployees.Click
OleDbDataAdapter1.Update(DsEmployee1)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
OleDbDataAdapter1.Update(DsEmployee1)
End Sub

If I click the label, my DB doesn't get updated. If I click the button
however it will.

This is only when updating information in fields. If I delete a row then
either label or button works fine.

Anyone know why this is?

mohamed.mossad NO[at]SPAM egdsc.microsoft.com
6/23/2004 8:25:12 AM
hi Justin
Have you tried to a simple statement inside the label click handler
to make sure if the handler is called in the first place , for example ,
try simple messageBox inside that handler to see it is called when the
event is fired or not . I recommend so because the two handlers are exactly
the same so it is not normal that they have different behavior, probably
what happens is that the label one is not executed at all. hope that helps.

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
Justin Emlay
6/23/2004 8:43:17 AM
Yes, both handlers are working. As I stated when you delete a row/record
and click the label it works fine. It's just when you are updating a field.

I also went back to older projects of mine and converted buttons in to
labels. Sure enough the same problem occurred. Deleting records was fine
however updating fields was a no go.

You simpley can not update a db via a label_click handler. I would assume
this is a bug.



[quoted text, click to view]

AddThis Social Bookmark Button