Using the ExecuteScalar method in the SQL Command object, how can you check to see if the result set is empty? I am using ASP.net, C#, and MS SQL 2008. Right now when I run the following code the Response.Write returns a 0 when the resultset is empty. But I would like to differentiate between […]
Category: sql
SQL Server- ORDER BY CASE
I have the following the query running dynamically SELECT * FROM Vehicles WHERE (DKID IN (69954)) ORDER BY case when ImageName1 = ‘na’ then 0 else 1 end, Make , Model, Year DESC This is returning the following error: Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near ‘na’.