can i update database column through listbox data?
Code:
Dim conn As SqlCeConnection = Nothing
Try
conn = New SqlCeConnection("Data Source=" & userSpecifiedPath)
conn.Open()
Dim cmd As SqlCeCommand = conn.CreateCommand()
Dim dAdp As SqlCeDataAdapter = New SqlCeDataAdapter()
Dim ds As New DataSet
cmd.CommandText = String.Format("UPDATE TABLE SET NUMBER = '{0}' WHERE '{1}' = '{2}'", zero, ListBox3.Items, DATE)
dAdp.UpdateCommand = cmd
cmd.ExecuteNonQuery()
Catch ex As Exception
Finally
conn.Close()
End Try
i want to update the column(number) where listbox3.items is equal to date.
Code:
cmd.CommandText = String.Format("UPDATE TABLE SET NUMBER = '{0}' WHERE '{1}' = '{2}'", zero, ListBox3.Items, DATE)
Re: can i update database column through listbox data?
This obviously doesn't make any sense. You can match a selected item, or a specifically indexed item, but you cant match all the items as a collection.
Re: can i update database column through listbox data?
can i insert the listbox items in a selected column in database ?