如何连接到mongoLab?

时间:2015-05-21 20:48:09

标签: mongodb mean-stack mlab

我开发了一个简单的MEAN堆栈CRUD应用程序。我将我的网站部署到azure网站。在我的localhost中,该应用程序正常工作。但我想连接mongoLab数据库。我怎么连接它?

  

这是server.js的代码

{{1}}

如何建立连接?我有azure提供的连接信息。 非常感谢。

1 个答案:

答案 0 :(得分:0)

您能查看确切的Exception错误消息吗? 尝试以下内容:

      try
        {
            smtp.Send(msg);
            Response.Write("<script>alert('Mensaje enviado correctamente');</script>");
            NullTextBox();
        }
        catch (Exception ex) 
        {
            Response.Write(string.Format("<script>alert('There is an error on connection to DB on microsoft azure:{0}');</script>", ex.ToString()));
            NullTextBox();
        }

enter image description here

相关问题