Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends ,

here i completed my windows application , and i did setup .exe file that i installed and checks the application , but while inserting a values getting an error {Operation must use an updateable query}database is Ms access 2007 , using WPF .

this code works fine in visual studio while executing but after making an setup .exe and installation of this application getting error while inserting a values.

please help me out of this ,from past 10 days i was searching in online and rectifying this error .

OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|/database/phonebook.accdb;Persist Security Info=True;Jet OLEDB:Database Password=mr.vj;");

                cmdd.CommandText = "INSERT into logindetails([lusername],[login]) VALUES(@luname,@last)";
                cmdd.Parameters.AddWithValue("@luname", textBoxname.Text);
                cmdd.Parameters.AddWithValue("@last", llin);
                cmdd.ExecuteNonQuery();//here i getting an error 'Operation must use an updateable query"

thanking you in advance .
Updated 10-Apr-14 21:28pm
BulletVictim 11-Apr-14 7:12am    
This only happends on other computers where the .exe is being installed and not if installed on the development computer?
If that is the case then it is the administrative rights on the "client computer" that does not allow the database to be modified by a non administrator user.
Oh and it might also be that the database file is set to read only.
Mr.VJ 29-Apr-14 3:19am    
where should i give the permissions

1 solution

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