简体   繁体   English

INSERT语句在WEB SERVER中不起作用

[英]INSERT statement doesn't work in WEB SERVER

IN localhost insert statement WORKS PERFECTLY ( insert data in database sql management server) but from web server it doesn't ( update, delete works but not insert). 在本地主机插入语句中可以正常工作(在数据库sql管理服务器中插入数据),但在Web服务器中则不能(更新,删除有效,但不能插入)。

I am using sql connection , string str = insert into dtbase.dbo.candidat values (). 我正在使用sql连接,字符串str =插入dtbase.dbo.candidat值()。 command cmd = new command (sql, connection) 命令cmd =新命令(SQL,连接)

Can someone please tell me why it doesn;t work from wb server ( I am using web application.) do i need to add some permision in web.config? 有人可以告诉我为什么它不起作用;不能从wb服务器上运行(我正在使用Web应用程序。)我是否需要在web.config中添加一些功能?

若要确定这是否是权限问题(我认为是),然后暂时 (这是针对那些不赞成投票的人),请使用您知道可以访问您的网络和SQL Server实例的帐户来启用ASP.Net模拟: http//support.microsoft.com/kb/306158

Based on the other comments, I agree that it sounds like a permissions issue. 根据其他评论,我同意这听起来像是权限问题。

You may be getting the error using database.dbo.table because your table was created under a different schema (ie. database.user.table ) and you're trying to access that schema from a user that doesn't have permissions to that schema. 您可能使用database.dbo.table遇到了错误,因为您的表是在不同的架构下创建的(即database.user.table ),并且您正试图从没有该权限的用户访问该架构模式。

Does your connection string change from localhost to your production server? 您的连接字符串是否从localhost更改为生产服务器?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM