我正在尝试将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字段。