标题:IndexOutOfRangeException的问题
取消只看楼主
释然
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-9-22
结帖率:100%
 问题点数:0 回复次数:1 
IndexOutOfRangeException的问题
SqlConnection RegCon = new SqlConnection(ConfigurationManager.AppSettings["SQLConn"]);
        RegCon.Open();
        SqlCommand checkname = new SqlCommand("select count (*) from UserInfo where Name='" + this.LoginIDEnter.Text + "' and  PW='" + this.LoginPWEnter.Text + "'",RegCon);
        SqlDataReader checkid = checkname.ExecuteReader();
        
        if (checkid.Read())
        {
            userid = checkid["Name"].ToString();
        }

在userid = checkid["Name"].ToString()这里报错,请问是错在哪里?谢谢。
搜索更多相关主题的帖子: count where 
2008-12-12 21:22
释然
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-9-22
得分:0 
……囧原来如此。谢谢LS两位m<_ _>m

2008-12-13 09:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-249013-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.219968 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved