Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Sql Server CE - The column name is not valid. [ Node name (if any) = ,Column name = ]

$
0
0

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


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>