user1165435
user1165435

Reputation: 231

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).

I am using sql connection , string str = insert into dtbase.dbo.candidat values (). command cmd = new command (sql, connection)

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?

Upvotes: 0

Views: 473

Answers (2)

Anthony Shaw
Anthony Shaw

Reputation: 8166

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.

Does your connection string change from localhost to your production server?

Upvotes: 0

Mark Kram
Mark Kram

Reputation: 5842

To determine if this is a permissions issue (which I think it is) or not then temporarily (this is for the down voters out there) enable ASP.Net Impersonation by using an account that you know has access to your network and SQL Server instance: http://support.microsoft.com/kb/306158

Upvotes: 1

Related Questions