让 MVC3 使用 Oracle 来实现用户角色和成员身份

发布于 2025-01-05 15:11:39 字数 593 浏览 4 评论 0原文

我在让 MVC3 前端使用 Oracle 11g 数据库保存用户成员资格时遇到问题。

我一直在关注这个 简单教程,但无法让它工作。

到目前为止我已经完成的一些事情:

  • 下载并安装了 Oracle Data Provider for .NET (ODAC 11.2 版本 4 (11.2.0.3.0) )
  • 针对数据库运行 InstallAllOracleASPNETProviders.sql 开发服务器。
  • 通过 SQL Developer 测试连接(使用 TNSNames 文件) 没有任何问题。
  • 无法创建与服务器下数据库的连接 资源管理器窗格是 Visual Studio 2010,这似乎是相关的。

检查数据库后,我可以看到“ORA_ASPNET_”表已创建正常。

我很乐意指导我出错的地方,因为这应该很容易。

I'm having problems getting my MVC3 front end to use an Oracle 11g database to hold the user memberships.

I've been following this simple tutorial but can't get it to work.

Some things I've done so far:

  • Downloaded and installed the Oracle Data Provider for .NET (ODAC 11.2
    Release 4 (11.2.0.3.0) )
  • Run the InstallAllOracleASPNETProviders.sql against the database on
    the development server.
  • Tested the connection via SQL developer (using the TNSNames file)
    with no issues.
  • Unable to create a connection to the database under the Server
    Explorer pane is Visual Studio 2010 which seems related.

Having checked the database I can see that the "ORA_ASPNET_" tables have been created OK.

I'd appreciate a steer on where I'm going wrong as this SHOULD be easy.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柳若烟 2025-01-12 15:11:39

该问题似乎与连接字符串有关。

我一直在使用 TNS 名称文件来获取连接详细信息,但该文件没有被获取。

我修改了连接字符串以包括服务器、端口和服务名称,如下所示:

  <connectionStrings>
    <add name="OraAspNetConnectionString" 
      connectionString="Data Source=svr56:1521/TCO1103;Persist Security Info=True;User ID=Ora_Asp;Password=*****;" 
      providerName="Oracle.DataAccess.Client="/>
  </connectionStrings>

创建连接的问题是,一旦我在“数据源名称”框中使用相同的详细信息,服务器资源管理器也会自行解决。

svr56:1521/TCO1103;保留安全信息=True;用户
ID=Ora_Asp;密码=*****;
在此处输入图像描述

The problem appeared to be related to the connection string.

I had been using the TNS names file for the connection details but this wasn't being picked up.

I modified the connection string to include the server, port and service name as follows:

  <connectionStrings>
    <add name="OraAspNetConnectionString" 
      connectionString="Data Source=svr56:1521/TCO1103;Persist Security Info=True;User ID=Ora_Asp;Password=*****;" 
      providerName="Oracle.DataAccess.Client="/>
  </connectionStrings>

The problem creating the connection is the Server Explorer also resolved itself once I used the same details in the Data source name box.

svr56:1521/TCO1103;Persist Security Info=True;User
ID=Ora_Asp;Password=*****;
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文