Errore simile....
i campi sono così:
codice:
Int32 Id;
string tableName="[stati]";
// qNewsID = Convert.ToInt32(Request.QueryString["NewsID"]);
Id= Convert.ToInt32(Request.QueryString["Cod"]);
string CampoAgg=(Request.QueryString["stat"]);
Access.modRecord(tableName, Id, CampoAgg);
La stringa è questa:
codice:
OleDbCommand comm = new OleDbCommand("UPDATE " + tableName + " SET stato="+ CampoAgg +"WHERE ID_Stato=" + Id ,conn);
L'errore è questo:
Errore di sintassi (operatore mancante) nell'espressione della query '-'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Errore di sintassi (operatore mancante) nell'espressione della query '-'.
Source Error:
Line 71: conn.Open();
Line 72: OleDbCommand comm = new OleDbCommand("UPDATE " + tableName + " SET stato="+ CampoAgg +"WHERE ID_Stato=" + Id ,conn);
Line 73: comm.ExecuteNonQuery();
Line 74: conn.Close();
Line 75: }
Source File: c:\inetpub\wwwroot\xxx\areariservata\Access.cs Line: 73
---
Ho una mezza idea, cioè che vuole traparentesi quadre anche CampoAgg, ma non mi convince...