2010-07-23 80 views
0

StackOverflow - 我仍在尝试部署此站点,但是随着我解决的每一个问题,都会出现另一个问题。无论如何 - 我已经在我的主机上建立了数据库以允许远程连接,并且正在运行Sql Server 2005.在我的开发机器上,我正在使用Sql Server 2008.访问远程存储过程时语法错误不正确

我已经安装了asp.net架构在我的托管数据库上,并从ASP.NET Web管理界面创建了多个用户,并测试了登录的工作方式。使用远程连接字符串在本地运行应用程序可获得相同的结果。但是 - 我能够运行我的脚本并生成我的表和存储过程而没有错误 - 但是当站点运行时,我在尝试访问存储过程的所有.aspx页面上出现以下错误:

Server Error in '/' Application. 
Incorrect syntax near 'LoadProfileData'. 
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 'LoadProfileData'. 

Source Error: 

Line 62:    adapter.SelectCommand.Parameters.Add("@ProfessionalName", SqlDbType.VarChar).Value = professionalName; 
Line 63:    DataSet profile = new DataSet(); 
Line 64:    adapter.Fill(profile, "Profile"); 
Line 65:    return profile; 
Line 66:   } 

这是一个可能的Sql 2005 vs 2008问题?我希望有人在类似的情况下看到了这个问题,并可以指出我正确的方向。该服务器正在运行asp.net 2.0,3.0和3.5以及IIS 7.0。

回答

0

认为我们确实需要看到proc,你发布的消息表明它是一个语法错误,也许你正在使用proc中的sql2008特性。 如果您正在开发SQL 2008,请尝试将数据库兼容性级别设置为9,并查看是否得到相同的错误。

+0

嘿,谢谢你的答案,但这是从服务器故障迁移的重复问题。我需要在DAL中的过程调用之前添加“exec”。 – Gallen 2010-07-26 20:45:52