c# - 如果在选择查询c#中的行受到影响后条件失败
问题描述
using (SqlCommand command7 = new SqlCommand("select * from table where cokumn2 = 'YES'", conn))
{
command7.CommandType = CommandType.Text;
using (SqlDataReader dr = command7.ExecuteReader())
{
if (dr.HasRows)
{
try
{ MailMessage mail = new MailMessage(); }
catch (Exception) {}
}
}
}
即使选择查询受到影响的行,它也不会进入 if 条件,请对此提供帮助
解决方案
推荐阅读
- .net-core - 使用 Projections 不会加载使用数据加载器解析的字段
- xamarin.forms - Xamarin 表单 PropertyChanged 对象为空
- r - 错误:“命名空间:ff”未导出对象“克隆”
- spring - 如何从 com.ibm.mq.MQException 中恢复:MQJE001:完成代码“2”,原因“2009”
- python - Python:要求用户输入数字,选择1则打印文本,否则退出程序
- php - WordPress 和 WPBakery 更新后无法加载更多帖子项目
- r - 在 R 中解析 XML-TEI 并转换为语料库
- java - 如何在 Java 中找到质数?
- windows - 检查批处理文件是否在PowerShell中成功运行
- javascript - Facebook Instant Game JS Cookie Chrome 错误