eng.mohamed_elqpany Posted November 23, 2006 Share Posted November 23, 2006 Hello every body, Firstly, thanx for every one helped me before. and now i have a problem with this code. It works fine when running it from visual studio.net but when i run it from IIS it geives me an exception.this is the code: OleDbConnection con = new OleDbConnection(); con.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" + @"Data source= |DataDirectory|\\MaillingList.mdb"; try { con.Open(); string str; str = "Insert Into news (NewDate,Title,Brief,Cate,news,imageUrl) values ('" + date + "','" + title + "','" + brief + "','" + category + "','" + news + "','" + ok + "')"; OleDbCommand cmd = new OleDbCommand(str, con); cmd.ExecuteNonQuery(); } catch (Exception ex) { Response.Write(ex.ToString()); } finally { con.Close(); } and this is the exception i have.System.Data.OleDb.OleDbException: Operation must use an updateable query. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at news_Default.Button1_Click(Object sender, EventArgs e) in c:\ProLight Site\news\contents.aspx.cs:line 176line 176 us the line of excute comandcmd.ExecuteNonQuery();i need ur help.with regards;.. Link to comment Share on other sites More sharing options...
Mr.Jay Posted November 24, 2006 Share Posted November 24, 2006 It looks as if your database is read-only or you do not have permissions set correctly.Try following this tutorial for help: http://www.webwizguide.com/asp/faq/server_permissions.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now