本帖最后由 tammypoor 于 2010-06-17 00:08:10 编辑

解决方案 »

  1.   

    http://download.csdn.net/source/2452790,
    sessionhelp类,可以写成dll以备不时之需!
      

  2.   

    写得太复杂了,其实,只用一个Session保存这整个对象就可以了。
      

  3.   

    1. 如果在当前页需使用其他页面,则在开头应写入
    <!--#include file=路径/其他页.asp -->2. Session的使用,如果Session在其他页成功被赋值,那没在规定时间范围内都可以跨页面使用,例如:
    <span>名字:<%=Session("strName")%></span>
      

  4.   


    Dim strID,strName,strCollege,strMajor,intBalance
    Session("strID")=conn.execute("select * from users where ID='"&strID&"')
    Session("strName")=conn.execute("select * from users where Name='"&strName&"')
    Session("strCollege")=conn.execute("select * from users where College='"&strCollege&"')
    Session("strMajor")=conn.execute("select * from users where Major='"&strMajor&"')
    Session("intBalance")=conn.execute("select * from users where Balance='"&intBalance&"'你返回的是一个数据表,确用Session来记录???!!!!建议好好学习一下SQL-_______-!!!
      

  5.   

    登录页:<%
    if request("Submit") ="登录" then
         sql="select * from users where 登录名 = "&"'"&request("name")&"'"&"and 密码="&SQLstr(request("pwd"))
         set rs = CreateObject("ADODB.Recordset")
         set rs=conn.execute(sql)
          if not rs.eof then
             session("ABCD")=rs("ID")&"&nbsp;"&rs("Name")&"&nbsp;"&rs("College")&"&nbsp;"&rs("Major")&"<br>同学你好,欢迎使用四川大学一卡通系统<br>您的账户余额为"&rs("intBalance")
          else
             response.write "<script>"
     response.write "alert(""没有这个用户或密码错误!"");"
     response.write "window.location.href='default.asp';"
     response.write "</script>"
          end if
    end if
    %>
    在需要页内使用:
    <span>登录信息:<%=Session("ABCD")%></span>
      

  6.   

    Dim strID,strName,strCollege,strMajor,intBalance
    Session("strID")=conn.execute("select * from users where ID='"&strID&"')
    Session("strName")=conn.execute("select * from users where Name='"&strName&"')
    Session("strCollege")=conn.execute("select * from users where College='"&strCollege&"')
    Session("strMajor")=conn.execute("select * from users where Major='"&strMajor&"')
    Session("intBalance")=conn.execute("select * from users where Balance='"&intBalance&"'
    Session("****")这个好像是存的整个表吧
      

  7.   

    我还是不太明白我登陆界面已经做好了已经登陆成功了然后就需要在登录后的页面显示个人信息session("****")这个我是看的书
      

  8.   

    <%Dim strID,strName,strCollege,strMajor,intBalance
    Session("strID")=conn.execute("select strID from users where ID='"&strID&"')
    Session("strName")=conn.execute("select strName from users where Name='"&strName&"')
    Session("strCollege")=conn.execute("select strCollege from users where College='"&strCollege&"')
    Session("strMajor")=conn.execute("select strMajor from users where Major='"&strMajor&"')
    Session("intBalance")=conn.execute("select intBalance from users where Balance='"&intBalance&"')Label1.Text=Session("strID")
    Label2.Text=Session("strName")
    Label3.Text=Session("strCollege")
    Label4.Text=Session("strMajor")
    Label5.Text=Session("intBalance")Response.write strID&"&nbsp;"strName&"&nbsp;"strCollege&"&nbsp;"strMajor&"<br>"
    Response.write"同学你好,欢迎使用四川大学一卡通系统<br>"
    Response.write"您的账户余额为"&intBalance
    %>
    <form action="data/data_show.asp" name="right" method="post">
    <tr>
    <td></td>
    <td><asp:Label ID="Label1" runat="server"></asp:Label></td>
    <td><asp:Label ID="Label2" runat="server"></asp:Label></td>
    <td><asp:Label ID="Label3" runat="server"></asp:Label></td>
    <td><asp:Label ID="Label4" runat="server"></asp:Label></td>
    </tr>
    </table>
    </form>
      

  9.   

    session 一个id就够了吧
    剩下的都可以用id查询出来
      

  10.   

    Dim strID,strName,strCollege,strMajor,intBalance//你这里是干什么呀?定义变量吗???你现在是什么语言?C#里的话,你不能这样定义,变量是要指定类型的,如int strID;
    Session("strID")=conn.execute("select * from users where ID='"&strID&"')
    strID=Session("strID")//你这里是做啥????你到底是在什么语言下的嘛?Session["strID"]=conn.execute("select * from users where ID='"&strID&"')
    strID=Convert.ToInt32(Session["strID"]);//我这里改为C#下使用的//我总感觉楼主的语言不对书,哎,看习惯了C#的优雅,看别的一些语言,还真是有点郁闷了
      

  11.   

    通过ID取出所有的
    dv=conn.execute("select strID from users where ID='"&strID&"')
    Session["strID"]=dv.table.row[0]["ID"].tostring();
    Session["strName"]=dv.table.row[0]["Name"].tostring();
    以下类推 我记得括号是中括号不是小括号
      

  12.   

    我是看的asp
    我看的asp上就是这样定义的呀strID我是真的很菜鸟
    我压根就不懂这个
    逼我写代码
    太恼火了
      

  13.   

    杯具呀,看来CSDN得另开个ASP专区了楼上的你别火,代码这东西,得慢慢来
      

  14.   

    LZ也太强悍了吧  居然用那么多Session 存储数据这样服务器的压力比较大
      

  15.   

    建议用主键ID查询,输入到SESSION,代表唯一一个用户,否则数据库设计问题会带来多个记录