how to solve Operation must use an updateable query. error

Posted by Parthibansk under ASP.NET on 3/14/2013 | Points: 10 | Views : 5409 | Status : [Member] | Replies : 2
code works fine localy.but upload excel file in sever in server and insert value i encounter dis error

System.Data.OleDb.OleDbException: Operation must use an updateable query.

below is code:



string con = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Server.MapPath("~\\joinees\\joinees.xls") + ";" + "Extended Properties=Excel 8.0;";


OleDbConnection obj = new OleDbConnection(con);

obj.Open();

OleDbCommand cmd = new OleDbCommand("Insert into [Sheet1$](Name,email,phoneno) values('" + txtName.Text + "','" + txtEMAIL.Text + "','" + txtPHONE.Text + "')", obj);

cmd.ExecuteNonQuery();

Label1.Text = "Joined successfully";

txtName.Text = txtEMAIL.Text = txtPHONE.Text = string.Empty;

obj.Close();




Responses

Posted by: Santhi on: 3/14/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

Did you refer this link:
Refer this link:
This may be usefulhttp://www.beansoftware.com/ASP.NET-FAQ/Operation-Must-Use-An-Updateable-Query.aspx

Thanks & Regards,
Santhi .V

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Parthibansk on: 3/14/2013 [Member] Starter | Points: 25

Up
0
Down
refered it is related to file permission in access file[mdb]..how about excel file..

i gave file permission to excel file..but still the same error..

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response