using:vs.net with
vb.net
in my first form i use object list which is binded with database. then in the second to seventh form i fill the database with new entry. when i click the button "Sent" in the seventh form, the first form is reappeared with the list that supposed to be updated with the new entry. but in fact, the list still is not updated. i put my code to bind to object list in sub Form_active.
notes: when i debugged the code with vs.net, the form is updated. but i run the code, list cannot be updated.
here is the listing code:
Private Sub FormIklankanMobil_Activate(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormIklankanMobil.Activate
Dim dsDetilMobil As DataSet
dsDetilMobil = wsMobileAcc.dsDetilMobil(CType(User.Identity.Name, Double))
If dsDetilMobil.Tables(0).Rows.Count > 0 Then
lblStatus.Text = "Anda telah mempunyai " & dsDetilMobil.Tables(0).Rows.Count & _
" mobil yang hendak anda jual."
Else
lblStatus.Text = "Anda belum mempunyai mobil yang hendak anda jual."
End If
Dim dtCombine As DataTable = dsDetilMobil.Tables.Add("Combine")
Dim rowCombine As DataRow
Dim rowDetilMobil As DataRow
With dtCombine.Columns
.Add("btm", System.Type.GetType("System.String"))
.Add("tahun", System.Type.GetType("System.Double"))
.Add("warna", System.Type.GetType("System.String"))
.Add("lokasi", System.Type.GetType("System.String"))
.Add("harga", System.Type.GetType("System.String"))
End With
For Each rowDetilMobil In dsDetilMobil.Tables(0).Rows
rowCombine = dtCombine.NewRow
rowCombine("btm") = rowDetilMobil("merek") & " " & rowDetilMobil("tipe") & " " & _
rowDetilMobil("model")
rowCombine("tahun") = rowDetilMobil("tahun")
rowCombine("warna") = rowDetilMobil("warna")
rowCombine("lokasi") = rowDetilMobil("kota")
rowCombine("harga") = rowDetilMobil("harga")
dtCombine.Rows.Add(rowCombine)
Next
olStatus.DataSource = dsDetilMobil
olStatus.DataMember = "Combine"
olStatus.DataBind()
End Sub
any help would be much appreciated