我已经下载了API文件。我不确定如何连接到Clusterpoint数据库。当我运行这段代码时,我得到一条消息“连接字符串错误”。它还将有助于提供一个完整的crud示例的参考。谢谢。
string _url = @"https://api-eu.clusterpoint.com/v4"; //eu is correct
string _dbName = "db1";
string _username = "a@hotmail.com"; //not real
string _password = "..."; //not real
string _document = "document";
string _documentID = "//document/id";
Dictionary<string, string>
_dic = new Dictionary<string, string>(){ { "account", "0000" } }; //0000 not real
try
{
CPS_Connection cpsConnection = new CPS_Connection(_url, _dbName, _username, _password,
_document, _documentID, _dic);
/* CPS_Connection cpsConnection = new CPS_Connection(
"tcp://SERVER_IP:SERVER_PORT", "example", "username",
"password", "document",
"/document/id", new Dictionary<string, string>()
{ { "account", "<YOUR_ACCOUNT_ID>" } });
*/
}
catch (Exception e)
{
Console.WriteLine("Connection Error...."+e.Message);
Console.Read();
return;
}发布于 2015-12-02 15:39:29
如果您已经创建了Clusterpoint v4数据库,那么您只能使用REST连接到数据库并执行命令,因为Clusterpoint v4目前只提供REST API。可以在群集点文档中找到v4的连接代码示例:https://www.clusterpoint.com/docs/?page=5-Connection&version=4
如果您计划创建v3数据库,那么您可以下载适当的.NET API库并遵循下面的示例:https://www.clusterpoint.com/docs/?page=5-Connection&language=.NET&version=3
https://stackoverflow.com/questions/33978649
复制相似问题