发表主题回复主题
2/10‹‹1››

登陆整合的数据连接问题解决方法

imagecode

UID:3046

只看楼主   ¦        #1
  • 等级:0级
  • 昵称:图码
  • 组别:普通会员
  • 积分:27
  • 金币:19

昨天我给自己的网站首页做登陆整合功能,在看了帮助文档后,在conn这个参数上出了问题,始终是未定义.
后来通过咨询Lori知道页面需要从CVCommunity.Kernel.BasePage类派生,但是问题依然如故,后来终于恍然大悟,原来是这样的.
我的论坛在BBS目录下,我做的登陆页在根目录首页下,那个conn参数需要读web.config里面的两条数据,我根目录下的web.config里没有加上,所以总是出错.
现在我提供一下我的方法:
如果论坛是放在单独的目录下,那么需要在站点根目录下的web.config里加上这两句:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="DbProvider" value="CVCommunity.Provider.OleDbFactory, CVCommunity.Provider" />
    <add key="DbLink" value="//bbs/data/db.ascx" />  '假设你的论坛目录是BBS
  </appSettings>
</configuration>
然后把BBS目录下的web.config里的这两行删掉,否则会造成重复导致路径错误

在操作登陆的页中,修改这里:
Imports CVCommunity.Provider
Imports CVCommunity.Kernel
Imports CVCommunity.Kernel.DALFactory
Imports CVCommunity.Kernel.Handlers
Imports CVCommunity.Kernel.Entity
Partial Class _Default
    Inherits CVCommunity.Kernel.BasePage  '这里也是关键
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        '这样,就可以使用conn对象了
    End Sub
End Class

[该帖子由作者于2007年12月31日 21:51:08最后编辑]
Time: 07-12-31 21:07

http://www.imagecode.net

 
暂时空缺
›› 举报 ¦ 奖励 ¦ 引用 ¦  TOP   

imagecode

UID:3046

楼主¦       #2
  • 等级:0级
  • 昵称:图码
  • 组别:普通会员
  • 积分:27
  • 金币:19

这个方法有问题,我现在已经写了新的方法,看帖子:http://www.cnvery.net/topic.aspx?topicid=2037
Time: 08-01-02 14:04

http://www.imagecode.net

 
›› 举报 ¦ 奖励 ¦ 引用 ¦  TOP   
发表主题回复主题
2/10‹‹1››