Click here to Skip to main content
15,915,319 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all
I am beginner programmer I write a program and my program connect to the data base
with connection string but in my program appearance this error

The INSERT permission was denied on the object 'table name', database 'database name ', schema 'dbo'.
How to get permission to access table in data base ?
Do I change my code or my data base to solve this problem?
Posted

Hi,

you must change the permissions in the database-system.
The user you connect with, havent the permissions to change, update, ... the data.
 
Share this answer
 
Comments
`Thomas W. 10-Aug-11 3:39am    
If you have the right permissions for the user you connect with, something is wrong with the connectionstring.
I think your information about the databasename and/or tablename are wrong.
In your Errormessage you write you haven't the permission for schema 'dbo' but you said your databasename/ chema is 'store'.

Check or post your connectionstring to find the fault.
1) Go to your database and right click on the table.
2) Select properties then a small window will appear
3) Select Permission from the right side
4) Select the User/Role and give the access by checking the checkbox.
 
Share this answer
 
Comments
lilipoot 100 9-Aug-11 3:10am    
I do this order in my data base but having that error yet.
This may sound silly, but have you got a table called 'table name' and a database called 'database name' if you have fine. But to me sounds like you haven't named them properly. Could you post your connection string please?
 
Share this answer
 
Comments
lilipoot 100 9-Aug-11 5:25am    
my table and my data base have names
my database name is store and my table name foroshandegan
You dont have permission in SQLSERVER to insert any records for that particluar database. either change the sql connection string with the user credentials whose got insert promissions.(eg sa)
 
Share this answer
 
Comments
lilipoot 100 9-Aug-11 5:28am    
please explain your solution because my program connect to the database but i
don't insert,delete,...and what is meaning of (eg sa)
I should owner in data base
security.login.select user. select database.in user mapping
select owner
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900