Hi,
I'm trying to update a record in a table using the below update command.
sqlcmdObj= sqlConnObj.CreateCommand();
sqlcmdObj.CommandText = "UPDATE WS_LOCATION SET Frequency = @FreqParams, LUTime = @LUTimeParams" + sWorkSpaceName + sFolderName + ", Client = '" +
htInputParams["Client"].ToString().Replace("'", "''") + "', Matter = '" +
htInputParams["Matter"].ToString().Replace("'", "''") + "' WHERE WSLoc_ID = '" + strLocationId + "'";
transaction = sqlConnObj.BeginTransaction(IsolationLevel.Serializable);
sqlcmdObj.Connection = sqlConnObj
sqlcmdObj.Transaction = transaction;
SqlCeParameter FreqParams = sqlcmdObj.Parameters.Add("@FreqParams", SqlDbType.Int);
FreqParams.Value = frequency;
SqlCeParameter LUTimeParams = sqlcmdObj.Parameters.Add("@LUTimeParams", SqlDbType.DateTime);
LUTimeParams.Value = DateTime.Now;
sqlcmdObj.ExecuteNonQuery().
********************************
But ExecuteNonQuery() throws the below error message.
There was an error parsing the query. [ Token line number = 1,Token line offset = 76,Token in error = 14286 ] at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
at iwovEFS.DbAccess.UpdateFrequencyTable(Hashtable htInputParams)
at iwovEFS.DbAccess.InsertIntoLocationsTable(Hashtable htInputParams, Int32& errorcode) UPDATE WS_LOCATION SET Frequency = @FreqParams, LUTime = @LUTimeParams, WSName = '汉语/漢語', FolderName = '中文', Client = '', Matter = '' WHERE WSLoc_ID = '9'
occured on InsertIntoLocationTables.
Here wsname and foldername are chineese characters. What should be the problem? How do I resolve this issue?
Thanks