OleDB 换行符

OleDB newLine character

我对 oleDB \n \r 解析有问题。

我想将多行字符串传递给数据库。查询看起来是这样的:

"{call merge_procedure(12345, 'Datum poskytnutí '||chr(13)||chr(10)||' dokumentace')}"

但命令执行失败

Unspecified error
  at System.Data.OleDb.OleDbCommand.ProcessResults(OleDbHResult hr)
  at System.Data.OleDb.OleDbCommand.InitializeCommand(CommandBehavior behavior, Boolean throwifnotsupported)
  at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
  at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
  at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()

我尝试过的:

请问如何使用 oleDB 将多行字符串传递给数据库?

您可以尝试像这样设置字符串(如果它在 c# 中):

@"数据后置
文档

作为Wernfried Domscheit wrote in ,如果我绑定参数它就可以工作。

call merge_procedure(12345, {0})

或 C#

string.Format("call merge_procedure(12345, 'Datum poskytnutí {0} dokumentace'))", Environment.NewLine);