Hi All,
I wanna update the Stock value with the update one drom Listbox,
I have put this code, run but the result is null.
[code] drop_column
add_column
dim totalrow as integer
totalrow = stocklist.listcount-1
for x as integer = 0 to totalrow
dim a,b,c,d as string
a=stocklist.cell(x,0) 'ID column
d=stocklist.cell(x,3) 'Stock Column
If AddTeamRow11(a,d) then
dim lox as Integer
for lox = 0 to stocklist.ListCount -1
stocklist.Cell(lox,0)=str(val(nomor.text)+1)
nomor.Text=str(val(nomor.text)+1)
next
nomor.text="0"
l_connection.Text = "3 rows added to Team."
Else
'AddDataStatusLabel.Text = "There was an error adding the data."
End If
next[/code]
Addteamrow11 code,
[code] If Not IsConnected Then
MsgBox(“Connect to the database and create the table first.”)
Return False
End If
Dim row As New DatabaseRecord
// ID will be added automatically
row.Column(“ID”) = ID
row.Column(“stock”) = stok
mDB.InsertRecord(“master”, row)
If mDB.Error Then
l_connection.Text = "DB Error: " + mDB.ErrorMessage
Return False
End If
Return True[/code]
Drop_column Code
[code] Dim sql As String
sql = “ALTER TABLE master DROP COLUMN stock”
Dim data As RecordSet
data = mDB.SQLSelect(sql)
[/code]
Add Column Code,
[code] Dim sql As String
sql = “ALTER TABLE master ADD COLUMN stock TEXT”
Dim data As RecordSet
data = mDB.SQLSelect(sql)
[/code]
I was trying to use an UPDATE command, but no luck,
any helps…?
Thanks
Arief