我有以下的sql命令通过代码,因为当我评估更新后的sql行,该列只是空的时,参数包含正斜杠。如何逃避正斜杠?
sqlCommand.CommandText = String.Format("update {0} set {1}='{2}'where id = @Id",
tableName, ColumnName, forwardSlashText);
sqlCommand.Parameters.Add("@Id", SqlDbType.UniqueIdentifier).Value = rowId;
numRowsAffected = sqlCommand.ExecuteNonQuery();
添加log.debug该指令i得到以下输出...
更新MY_TABLE_NAME设置 MIME_TYPE = '应用/ PDF' 其中id = @Id
所以我会假设该命令是正确的,但随后看行mime_type列是空的。
问题可能是在其他地方,例如,在分配'forwardSlashText'值或'rowId'值告诉我们,代码 – RedFilter 2010-04-30 12:24:51