Reputation: 231
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
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
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