level 1
zclltl
楼主
我下面的这程序显示空也能执行正确,怎么才能不能显示为空!在线等大虾解答!
谢谢!
protected void btn_Check_Click(object sender, EventArgs e)
{
DB db = new DB();
String SqlStr = "select * from 会员表 where 会员名='" + this.会员名.Text + "'";
DataSet Ds = new DataSet();
try
{
Ds.Clear();
Ds = db.GetDataTableBySql(SqlStr);
if (Ds.Tables[0].Rows.Count == 0)
{
this.Label1.Text = "恭喜您,此会员名可以使用!";
}
else
{
this.Label1.Text = "对不起,此会员已经被注册,请输入其他用户名!";
}
}
catch (Exception)
{
this.Label1.Text = "没有得到任何数据,请重试!";
}
}
2013年04月10日 01点04分
1
protected void btn_Check_Click(object sender, EventArgs e)
{
DB db = new DB();
String SqlStr = "select * from 会员表 where 会员名='" + this.会员名.Text + "'";
DataSet Ds = new DataSet();
try
{
Ds.Clear();
Ds = db.GetDataTableBySql(SqlStr);
if (Ds.Tables[0].Rows.Count == 0)
{
this.Label1.Text = "恭喜您,此会员名可以使用!";
}
else
{
this.Label1.Text = "对不起,此会员已经被注册,请输入其他用户名!";
}
}
catch (Exception)
{
this.Label1.Text = "没有得到任何数据,请重试!";
}
}
