如果单纯是为了得到行数,这样就成了:
select count(*) from title where titleid = 194 and postuser='ttttt'如果你要在程序中获取执行完SQL语句后所影响的行数,不能直接支持,好象只有通过SQL语句来获取
select count(*) from title where titleid = 194 and postuser='ttttt'如果你要在程序中获取执行完SQL语句后所影响的行数,不能直接支持,好象只有通过SQL语句来获取
select count(*) from title where titleid = 194 and postuser='ttttt'
获得
不是select.
go
select count(*) from title where titleid = 194 and postuser='ttttt'
go要想写成一句,你尝试下上面这段是否可行,我这没.NET
不然就只有分开为两句SQL来执行了
int nAffectedRows = cmd.ExecuteNonQuery();
返回的是什么类型,怎么获取这个数值??
在SQL SERVER端执行当然是满足,但楼主好象是要在页面端读取,那就不成了
[C#]
public int ExecuteNonQuery();受影响的行数。思归的最简单,我是很少使用ASPX.NET方面的东西的,所以更多是采用SQL来完成的