I been new to using SQL and I’ve been getting an error:
sql construct or statement is not supported
In visual studio each time I execute this statement:
IF (SELECT [Product_Availability] FROM Product WHERE [Product_Name] = @name) = 'True'
UPDATE [Product] SET [Product_Availability] = 'False'
WHERE ([Product_Name] = @name)
ELSE
UPDATE Product SET [Product_Availability] = 'True'
WHERE ([Product_Name] = @name)
Though it works despite the error in the query part of visual studio; however, it doesn’t when I call it inside my database handler class. Any help would be appreciated!
Why not simplify to a single statement instead of all these if/else things?