OrientDB Query有时会工作,有时会抛出FormatException

时间:2014-04-16 19:27:34

标签: c# orientdb

我在下面的查询中遇到问题。我正在使用C#驱动程序连接到OrientDB并在我的c#代码中运行查询。所有这些代码都在一个循环中,try块中的查询可以进行多次迭代,然后失败抛出FormatException。在它失败时,我复制出查询并在orientDB web界面中运行它并返回expect记录,所以我确定它不是输入。所以我很困惑为什么它有时成功并且在其他时候失败,即使输入字符串是正确的。有谁遇到过类似的问题?有人请帮忙。

string origin = route[i].Trim();
string destination = route[i + 1].Trim();

List<ODocument> document = new List<ODocument>();

try
{

 document = database.Query("select from (traverse out_Connects from " + origin + ")     where in = " + destination);

 //document = database.Query("select from Connects where (out = " + origin + " and in = " + destination + ")");
}
catch (Exception e)
{
//document = database.Query("select from Connects where (out = " + origin + " and in = " + destination + ")");
}

enter image description here

0 个答案:

没有答案