ExecuteScalar,ExecuteReader,ExecuteNonQuery区别
ExecuteScalaris typically used when your query returns a single value. If it returns more, then the result is the first column of the first row. An example might beSELECT @@IDENTITY AS 'Identity'.ExecuteReaderis used for any result set with multiple rows/columns (e.g.,SELECT col1, col2 from sometable).ExecuteNonQueryis typically used for SQL statements without results (e.g., UPDATE, INSERT, etc.).
此随笔或为自己所写、或为转载于网络。仅用于个人收集及备忘。

浙公网安备 33010602011771号