本文介绍了当使用的ExecuteScalar,的ExecuteReader,的ExecuteNonQuery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很困惑,以获得使用
When to use these methods?
解决方案
ExecuteScalar() only returns the value from the first column of the first row of your query.
ExecuteReader() returns an object that can iterate over the entire result set.
ExecuteNonQuery() does not return data at all: only the number of rows affected by an insert, update, or delete.
Additionally, this seems like a good time for you to get familiar with MSDN. This is what documentation is made for: you have the method names. Go look them up.
这篇关于当使用的ExecuteScalar,的ExecuteReader,的ExecuteNonQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!