我是这么写的 ALTER PROCEDURE GetCount AS SELECT COUNT(*) FROM [AllMessage] RETURN public int Count() { int RowCount; string Constr = ConfigurationManager.ConnectionStrings["Constr"].ConnectionString; SqlHelper GetCount = new SqlHelper(); RowCount = Convert.ToInt32(GetCount.ExecuteScalar(Constr, CommandType.StoredProcedure, "GetCount")); return RowCount; }