首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用C#连接到聚集点数据库?

如何使用C#连接到聚集点数据库?
EN

Stack Overflow用户
提问于 2015-11-29 10:12:25
回答 1查看 123关注 0票数 0

我已经下载了API文件。我不确定如何连接到Clusterpoint数据库。当我运行这段代码时,我得到一条消息“连接字符串错误”。它还将有助于提供一个完整的crud示例的参考。谢谢。

代码语言:javascript
复制
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;
}
EN

回答 1

Stack Overflow用户

发布于 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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33978649

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档