Johny Bravo
asked on
Operation must use an updateable query
Hi,,
I am trying to insert data in access table in my asp.net application.
Locally it is working fine but on my web server it is throwing the above exception.
What is the cause of this?
I am trying to insert data in access table in my asp.net application.
Locally it is working fine but on my web server it is throwing the above exception.
What is the cause of this?
can u post the sql ? does your sql include a select using aggregate functions or something?
ASKER
string connectionString = string.Format(Configuratio nSettings. AppSetting s["myconn" ], Server.MapPath(Configurati onSettings .AppSettin gs["finddb "]));
OleDbConnection con = new OleDbConnection(connection String);
con.Open();
string name = this.txtName.Text;
string cname = this.txtCompName.Text;
string number1 = this.txtContactNumber.Valu e;
string email1 = this.txtEmail.Text;
string address = this.txtAddress.Text;
string sqlinsert = "insert into MemberData (MName,CName,Number1,Email 1,Address) values ('" + name + "','" + cname + "','" + number1 + "','" + email1 + "','" + address + "')";
OleDbCommand cmdinsert = new OleDbCommand(sqlinsert, con);
cmdinsert.ExecuteNonQuery( );
OleDbConnection con = new OleDbConnection(connection
con.Open();
string name = this.txtName.Text;
string cname = this.txtCompName.Text;
string number1 = this.txtContactNumber.Valu
string email1 = this.txtEmail.Text;
string address = this.txtAddress.Text;
string sqlinsert = "insert into MemberData (MName,CName,Number1,Email
OleDbCommand cmdinsert = new OleDbCommand(sqlinsert, con);
cmdinsert.ExecuteNonQuery(
well from looking at your query, I cant see anything wrong with it
what datatype is Number1, is it text? if its numeric then remove the single quotes
string sqlinsert = "insert into MemberData (MName,CName,Number1,Email 1,Address) values ('" + name + "','" + cname + "'," + number1 + ",'" + email1 + "','" + address + "')";
Have u looked into using parameters ? have a look at how its done here http://aspnet101.com/aspnet101/tutorials.aspx?id=1
Also, look at this. It is talking about permissions http://forums.asp.net/t/154273.aspx
what datatype is Number1, is it text? if its numeric then remove the single quotes
string sqlinsert = "insert into MemberData (MName,CName,Number1,Email
Have u looked into using parameters ? have a look at how its done here http://aspnet101.com/aspnet101/tutorials.aspx?id=1
Also, look at this. It is talking about permissions http://forums.asp.net/t/154273.aspx
ASKER
actually it works fine on local machine but not on web server.
Does your Access DB have Read and Write permissions on the server?
ASKER
on the server????
Well I have uploaded the same mdb on the server.
Well I have uploaded the same mdb on the server.
ASKER
http://www.aryasolutions.in/newsletter/newsletters.aspx
the page showing error
the page showing error
if it works on your box then sounds like permissions. did u look a bit more at the last link I gave?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ya but I am not authorised to do anything on web server.
It is a third party server.
I can create a DSN for access.That's it what I can do there.
It is a third party server.
I can create a DSN for access.That's it what I can do there.
ASKER
Ok I am not getting that Security tab on the FTP but I am getting it on my machine.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok I'll post back if anything is updated
http://support.microsoft.com/kb/175168