本文介绍了在条件下使用数据时,数据未插入数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果条件在DataReader中变为假,我会尝试插入项目.条件运行良好,但数据未插入数据库中.这是下面的代码:请建议我为什么不插入

I try to insert the items if the condition become false with the DataReader. The condition runs fine but data is not inserted in database . Here is my code below: Please suggest me why its not inserting

推荐答案

if (pReader.HasRows)
{


}
else

{
   ...

这是做事的非常丑陋的方式.试试:

That is a very ugly way to do things. Try:

if (!pReader.HasRows)
{
   ...



这篇关于在条件下使用数据时,数据未插入数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 05:18
查看更多