Hi
I am trying to execute a IF NOT THEN...BEGIN....END statement stored in a string in VB.NET but am not having much luck. It says there is an error at "BEGIN":
Any ideas?
Thanks!
Ed
I am trying to execute a IF NOT THEN...BEGIN....END statement stored in a string in VB.NET but am not having much luck. It says there is an error at "BEGIN":
Code:
strSQL = "IF NOT EXISTS(SELECT * FROM AppsCheck_Apps WHERE ApplicationName='" & InstalledPrograms(i).DisplayName & "' " _
& "BEGIN " _
& "INSERT INTO AppsCheck_Apps (ApplicationName) VALUES ('" & InstalledPrograms(i).DisplayName & "')" _
& "END"
Any ideas?
Thanks!
Ed