Hello, I am new to ASP.NET, therefore I have a simple question: I want to read and update an existing row in my database with some new information. I have no problem with reading but very much problem with updating. I tried the below code, and I get a runtime error: System.Data.OleDb.OleDbException: Operation must use an updateable query. in the line: myAdapter.Update(myDataSet,"Tasks"); If I try UPDATE instead of SELECT in the SQL statement then I get: System.Data.OleDb.OleDbException: Syntax error in UPDATE statement. in the line: myAdapter.Fill(myDataSet,"Tasks"); This my code:
OleDbConnection myConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;"
+"Data Source=c:\\data.mdb");
myConnection.Open();
OleDbDataAdapter myAdapter = new OleDbDataAdapter("SELECT * FROM Tasks",myConnection);
OleDbCommandBuilder myBuild = new OleDbCommandBuilder(myAdapter);
DataSet myDataSet = new DataSet();
myAdapter.Fill(myDataSet,"Tasks");
TextBox1.Text = String.Format("{0}", myDataSet.Tables["Tasks"].Rows[0]["Number"]);
myDataSet.Tables["Tasks"].Rows[0]["Company"] = "Text"; //This is where I update the DataSet
myAdapter.Update(myDataSet,"Tasks");
myConnection.Close();
Peter Molnar