sqlcmdObject.ExecuteNonQuery() throws sqlcexception???
-
Friday, September 07, 2012 4:55 PM
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
All Replies
-
Tuesday, September 11, 2012 8:28 AMModerator
Hi wlan,
Thank you for your question.
I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
Thank you for your understanding and support.Thanks,
MaggiePlease remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
-
Thursday, September 13, 2012 7:10 PMModerator
Hi,
Does this problem only occur if the WSName and/or FolderName contain Chinese characters?
What version of SQL Server Compact Edition are you using?
Thanks,
Cathy Miller

