使用C#Applet连接到SQL Server数据库时出错

时间:2016-01-07 23:57:49

标签: c# sql-server applet

我正在尝试将C#applet链接到我安装的本地数据库。我不确定我是否正确使用连接语句WebSecurity.initializeDatabaseConnection

以下是_AppStart.cshtml文件的代码:

@{
    //WebSecurity.InitializeDatabaseConnection("Data Source= WITPB03DMBB\\SQLEXPRESS; initial catalog=callCenterFinal;uid=resnav;pwd=;pooling=false; Connect Timeout=45", "UserProfile", "UserId", "Email", autoCreateTables: true);

    WebSecurity.InitializeDatabaseConnection("callCenterFinal", "UserProfile", "UserId", "Email", autoCreateTables: true);

    //WebSecurity.InitializeDatabaseConnection("callCenter", "UserProfile", "UserId", "Email", autoCreateTables: false);
    //WebSecurity.InitializeDatabaseConnection("callCenterDatabase", "ccUsers", "id", "email", true);
    //WebSecurity.InitializeDatabaseConnection("Data Source= WITPB03DMBB\\SQLEXPRESS; initial catalog=callCenterFinal;uid=resnav;pwd=;pooling=false; Connect Timeout=45;", "System.Data.SqlClient", "UserProfile", "id", "email", true);
}

如果我使用以下行,注释掉的行是我尝试过的行:

//WebSecurity.InitializeDatabaseConnection("Data Source= WITPB03DMBB\\SQLEXPRESS; initial catalog=callCenterFinal;uid=resnav;pwd=;pooling=false; Connect Timeout=45", "UserProfile", "UserId", "Email", autoCreateTables: true)`

此行给出了连接成功的错误,但管道的另一侧没有数据。

我在上面的文本中取出了pwd字段。

0 个答案:

没有答案