Visual Studio中的服务器资源管理器(2010)

时间:2022-09-01 16:36:39

I'm working on Visual studio(2010) and using Server Explorer for database connectivity(SQL SERVER) . I am able to connect with it sql client easily, just the problem I'm facing is using the "WHERE" clause in sql query. When I write simple sql query like "Select * From Employee" then it is executing fine, but when I write "select * from Employee where EmpNo=1001 " Then it gives following error:

我正在使用Visual Studio(2010)并使用Server Explorer进行数据库连接(SQL SERVER)。我能够轻松地与它连接sql客户端,只是我面临的问题是在sql查询中使用“WHERE”子句。当我编写简单的SQL查询,如“Select * From Employee”,然后它正在执行正常,但当我写“select * from Employee where EmpNo = 1001”然后它给出以下错误:

Error in WHERE clause near 'Employee'. Unable to parse query text.

'Employee'附近的WHERE子句出错。无法解析查询文本。

Then when I click continue the error that comes is: SQL Execution Error: Error source: .NetSqlClientDataProvider Error Message: An expreesion of non-boolean type is provided where a condition is expected , near 'No'

然后,当我单击继续时,出现的错误是:SQL执行错误:错误源:.NetSqlClientDataProvider错误消息:在预期条件,“否”附近提供非布尔类型的表达式

Can someone please hepl with it..??

有人可以用它来解决.. ??

1 个解决方案

#1


0  

From your error message you must be putting a space between Emp and No.

从您的错误消息中,您必须在Emp和No.之间放置一个空格。

If the EmpNo fieldname is two words in your table, surround it with [] eg; [Emp No]

如果EmpNo字段名是表中的两个单词,请用[]例如; [Emp No]

#1


0  

From your error message you must be putting a space between Emp and No.

从您的错误消息中,您必须在Emp和No.之间放置一个空格。

If the EmpNo fieldname is two words in your table, surround it with [] eg; [Emp No]

如果EmpNo字段名是表中的两个单词,请用[]例如; [Emp No]