Hi,
i'm doing a desktop application using VS2005 with MSSQL 2005.
i have a problem with the where clause in the update statement while selecting the listbox item.
this is the code for the listbox in load page:
Code:Dim cmdView As New SqlCommand("select * from Appointment where contactID = '" & cID & "' and recordStatus = 'active'", conn)
lbApp.Items.Clear()
Dim dr As SqlDataReader
dr = cmdView.ExecuteReader()
While dr.Read
Dim a As String
Dim b As String
Dim c As String
Dim d As String
Dim f As String
Dim g As String
a = dr("time")
b = dr("actStatus")
c = dr("meetingPlace")
d = dr("note")
f = " "
g = a + f + b + f + c + f + d
lbApp.Items.Add(g)
End While
dr.Close()
conn.Close()
and this is my update query in the delete button event handler:
how do i put in the where clause in when i have 4 columns in the listbox?Code:mySQL = "update Appointment set recordStatus = 'deleted'"
so can i do this with listbox or have to do with datagridview?
I'd appreciate any input, thanks!
