how to update dataset in using vb

[b][red]This message was edited by angelxi at 2003-10-8 0:30:35[/red][/b][hr]
hi to all!!

I just want to ask on how to add and update records on the database. I have a difficult time in doing so. Actually i found some codes but when i apply it, it is not working.
Please Help me...

Heres the codes:

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim newRow As DataRow

newRow = CtreeDataSet.Tables("tbl_MEN_MenuTree").NewRow()

newRow.Item("MEN_Group_Nr") = txtGroup.Text
newRow.Item("MEN_Level") = txtLevel.Text
newRow.Item("MEN_Order") = txtOrder.Text
newRow.Item("MEN_IconID") = drpIconID.SelectedIndex
newRow.Item("MEN_SecurityLevel") = txtSecurity.Text
newRow.Item("MEN_Level_Header") = txtHeader.Text
newRow.Item("MEN_ImagePath") = txtPath.Text
newRow.Item("MEN_TargetFrame") = txtTarget.Text

dbAdapter.Update(CtreeDataSet, "tbl_MEN_MenuTree")
End Sub

The problem here is: it can't update the data in my database. I dont even know why?. The output doesnt change :(
Please help......:(

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!