if exists (select 用户名, 密码 from 用户表
where 用户名 = :txtUserID and 密码 = :txtPsw)
begin
print '正确'
......
end
else
print '错误'
......
end
where 用户名 = :txtUserID and 密码 = :txtPsw)
begin
print '正确'
......
end
else
print '错误'
......
end
解决方案 »
- 关机,重启,注销程序
- vs2008的DataSet
- 请问如何实现在一个win form启动时自动按下一个按钮?
- 高手指教!!!怎么返回上级目录啊?
- [急]sos 关于客户端证书的问题Certificate
- (高分求教)如何在客户端检查TextBox的text改变事件,并且调用服务器端的方法来处理。
- 能否在ASP.NET站点下运行一个永远运行的线程? (没分了可怜啊,回答出来的送一个压缩解压缩的DLL带引用说明的)
- 问 C# 中第三方组件如何安装?
- 关于Params数组中使用void关键字的问题
- 推荐数据库操作、连接(C#)
- 有什么办法可以不用知道字符串长度就能取到最后两位?
- 在WEB页面里的按钮点击,如何显示对话框
if(密码字段==输入的密码)
return 正确;
return 错误;
string strQuery="select * from where 用户名="+txtUerID.Text+" and 密码="+txtPsw.Text;//Execute strQuery
SqlConnection myConnection = new SqlConnection(myConnString);
SqlCommand myCommand = new SqlCommand(mySelectQuery,myConnection);
myConnection.Open();
SqlDataReader myReader;
myReader = myCommand.ExecuteReader();if(myReader.Read())
{
//用户名和密码正确
}
else
{
//用户名和密码错误
}// always call Close when done reading.
myReader.Close();
// Close the connection when done with it.
myConnection.Close();