1
喜行的數目,但我alwyas找回-1.Here是我的代碼:再回到表返回-1我tryng算表中的行數
using (connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = new SqlCommand("CountBooks", connection);
command.CommandType = CommandType.StoredProcedure;
numberOfBooks = command.ExecuteNonQuery();
}
這裏是我的查詢:
SELECT COUNT(*) FROM Books
如何才能得到正確的結果?