-->

Friday, April 4, 2014

How to fix Incorrect syntax near the keyword from in ASP.NET

How to fix Incorrect syntax near the keyword from in ASP.NET

Today i facing a new problem that is
Incorrect syntax near the keyword from
I am receiving this error message when i retrieve the record from the database table, this code is successfully run in visual studio 2010 or earlier but not successfully run in vs 2012 or higher. So I think about that error and solve the problem that is

Incorrect syntax near the keyword 'from'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'from'.

Solution 

use brackets around the table like

Select * from [products]

If you use aggregate operators  query then should use '()' like

Select count (*) from [products]

Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved