Deleting record from SQL
Posted on 2006-05-08
I have a program that allows employees to upload and delete files from a shared drive. I got the upload to work 100% and the delete to work 50%.
The files are listed in a VB listbox which are stored in SQL.
My delete process does delete the file from the shared drive, but does not delete the record from SQL. Here is my code THAT DOES NOT WORK.
Dim sSQL As String
Dim conn As SqlConnection = New SqlConnection("integrated security=SSPI;data source=SERVERNAME;persist security info=False;initial catalog=DATABASE")
Dim comm As New SqlCommand
sSQL = "DELETE * FROM loanfiles WHERE ([lnfile]=" & (lstUploadedFiles.Text) & ");"
comm.Connection = conn
comm.CommandText = sSQL
I am getting a syntax error on comm.ExecuteNonQuery()
This is urgent. Please help.