I have the sql like this SELECT 2, COUNT(3) AS [C3]
I run using ADO.NET using System.Data.SqlServerCe.dll and got this error
The column name is not valid. [ Node name (if any) = ,Column name = ]
Then I try in Sql Server Studio, the funny thing it works fine :
SELECT 2, COUNT(3) AS [C3] - Works and produce the result : 2, 1
, but
SELECT COUNT(3) AS [C3] - it throw error The column name is not valid. [ Node name (if any) = ,Column name = ]
, and
SELECT COUNT(3) AS [C3], 2 - Works and produce the result : 1 , 2
SELECT COUNT(3) AS [C3], COUNT(3) AS [C31] - it throw errorThe column name is not valid. [ Node name (if any) = ,Column name = ]
It's hard to be advanced programmer