我的逻辑层: /// <summary>
/// 统计情况
/// </summary>
/// <returns></returns>
public static SqlDataReader TongJi()
{
SqlParameter[] param = new SqlParameter[30]; param[0] = new SqlParameter("@AllowPreCount", 0);
param[1] = new SqlParameter("@AllPreArea", 0);
param[2] = new SqlParameter("@AllowPreZzCount", 0);
param[3] = new SqlParameter("@AllPreZzArea", 0);
param[4] = new SqlParameter("@AllowCount", 0);
param[5] = new SqlParameter("@AllArea", 0);
param[6] = new SqlParameter("@AllowZzCount", 0);
param[7] = new SqlParameter("@AllZzArea", 0);
param[8] = new SqlParameter("@PreCount", 0);
param[9] = new SqlParameter("@PreArea", 0);
param[10] = new SqlParameter("@PreZzCount", 0);
param[11] = new SqlParameter("@PreZzArea", 0);
param[12] = new SqlParameter("@TrueBuildCount", 0);
param[13] = new SqlParameter("@TrueArea", 0);
param[14] = new SqlParameter("@PreHouseRgCount", 0);
param[15] = new SqlParameter("@PreHouseRgArea", 0);
param[16] = new SqlParameter("@PreHouseRgZzCount", 0);
param[17] = new SqlParameter("@PreHouseRgZzArea", 0);
param[18] = new SqlParameter("@PreHouseCount", 0);
param[19] = new SqlParameter("@PreHouseArea", 0);
param[20] = new SqlParameter("@PreHouseZzCount", 0);
param[21] = new SqlParameter("@PreHouseZzArea", 0);
param[22] = new SqlParameter("@HouseRgCount", 0);
param[23] = new SqlParameter("@HouseRgArea", 0);
param[24] = new SqlParameter("@HouseRgZzCount", 0);
param[25] = new SqlParameter("@HouseRgZzArea", 0);
param[26] = new SqlParameter("@HouseCount", 0);
param[27] = new SqlParameter("@HouseArea", 0);
param[28] = new SqlParameter("@HouseZzCount", 0);
param[29] = new SqlParameter("@HouseZzArea", 0); return VisitBeiAn.RunDataReaderProceParam("WebStat", param);
}
我的数据访问层: public static SqlDataReader RunDataReaderProceParam(string strsql, SqlParameter[] param)
{
SqlConnection oconnection = new SqlConnection(connstr);
oconnection.Open();
SqlCommand ocommand = new SqlCommand(strsql);
ocommand.CommandType = CommandType.StoredProcedure;
ocommand.Connection = oconnection;
if (ocommand.Parameters.Count == 0)
{
foreach (SqlParameter p in param)
{
ocommand.Parameters.Add(p);
}
}
SqlDataReader sdr = ocommand.ExecuteReader();
return sdr;
}
我的存储过程:set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
goALTER procedure [dbo].[WebStat] @AllowPreCount int output ,@AllPreArea numeric(18,2) Output ,@AllowPreZzCount int Output ,@AllPreZzArea numeric(18,2) Output ,
@AllowCount int Output ,@AllArea numeric(18,2) Output ,@AllowZzCount int Output ,@AllZzArea numeric(18,2) Output ,
@PreCount int Output ,@PreArea numeric(18,2) Output ,@PreZzCount int Output ,@PreZzArea numeric(18,2) Output ,
@TrueBuildCount int Output ,@TrueArea numeric(18,2) Output ,
@PreHouseRgCount int Output , @PreHouseRgArea numeric(18,2) Output ,@PreHouseRgZzCount int Output , @PreHouseRgZzArea numeric(18,2) Output ,
@PreHouseCount int Output , @PreHouseArea numeric(18,2) Output ,@PreHouseZzCount int Output , @PreHouseZzArea numeric(18,2) Output ,
@HouseRgCount int Output , @HouseRgArea numeric(18,2) Output ,@HouseRgZzCount int Output , @HouseRgZzArea numeric(18,2) Output ,
@HouseCount int Output , @HouseArea numeric(18,2) Output ,@HouseZzCount int Output , @HouseZzArea numeric(18,2) Output asSELECT @AllowPreCount= COUNT(1) , @AllPreArea= SUM(YJZMJ)
FROM FWQK
WHERE (SFXYBA = '是') AND (ISNULL(cdid, 0) = 0)
下略应该是没有过错的啊,老是提示没有输入参加,我都要疯了,请大家帮忙。谢谢
/// 统计情况
/// </summary>
/// <returns></returns>
public static SqlDataReader TongJi()
{
SqlParameter[] param = new SqlParameter[30]; param[0] = new SqlParameter("@AllowPreCount", 0);
param[1] = new SqlParameter("@AllPreArea", 0);
param[2] = new SqlParameter("@AllowPreZzCount", 0);
param[3] = new SqlParameter("@AllPreZzArea", 0);
param[4] = new SqlParameter("@AllowCount", 0);
param[5] = new SqlParameter("@AllArea", 0);
param[6] = new SqlParameter("@AllowZzCount", 0);
param[7] = new SqlParameter("@AllZzArea", 0);
param[8] = new SqlParameter("@PreCount", 0);
param[9] = new SqlParameter("@PreArea", 0);
param[10] = new SqlParameter("@PreZzCount", 0);
param[11] = new SqlParameter("@PreZzArea", 0);
param[12] = new SqlParameter("@TrueBuildCount", 0);
param[13] = new SqlParameter("@TrueArea", 0);
param[14] = new SqlParameter("@PreHouseRgCount", 0);
param[15] = new SqlParameter("@PreHouseRgArea", 0);
param[16] = new SqlParameter("@PreHouseRgZzCount", 0);
param[17] = new SqlParameter("@PreHouseRgZzArea", 0);
param[18] = new SqlParameter("@PreHouseCount", 0);
param[19] = new SqlParameter("@PreHouseArea", 0);
param[20] = new SqlParameter("@PreHouseZzCount", 0);
param[21] = new SqlParameter("@PreHouseZzArea", 0);
param[22] = new SqlParameter("@HouseRgCount", 0);
param[23] = new SqlParameter("@HouseRgArea", 0);
param[24] = new SqlParameter("@HouseRgZzCount", 0);
param[25] = new SqlParameter("@HouseRgZzArea", 0);
param[26] = new SqlParameter("@HouseCount", 0);
param[27] = new SqlParameter("@HouseArea", 0);
param[28] = new SqlParameter("@HouseZzCount", 0);
param[29] = new SqlParameter("@HouseZzArea", 0); return VisitBeiAn.RunDataReaderProceParam("WebStat", param);
}
我的数据访问层: public static SqlDataReader RunDataReaderProceParam(string strsql, SqlParameter[] param)
{
SqlConnection oconnection = new SqlConnection(connstr);
oconnection.Open();
SqlCommand ocommand = new SqlCommand(strsql);
ocommand.CommandType = CommandType.StoredProcedure;
ocommand.Connection = oconnection;
if (ocommand.Parameters.Count == 0)
{
foreach (SqlParameter p in param)
{
ocommand.Parameters.Add(p);
}
}
SqlDataReader sdr = ocommand.ExecuteReader();
return sdr;
}
我的存储过程:set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
goALTER procedure [dbo].[WebStat] @AllowPreCount int output ,@AllPreArea numeric(18,2) Output ,@AllowPreZzCount int Output ,@AllPreZzArea numeric(18,2) Output ,
@AllowCount int Output ,@AllArea numeric(18,2) Output ,@AllowZzCount int Output ,@AllZzArea numeric(18,2) Output ,
@PreCount int Output ,@PreArea numeric(18,2) Output ,@PreZzCount int Output ,@PreZzArea numeric(18,2) Output ,
@TrueBuildCount int Output ,@TrueArea numeric(18,2) Output ,
@PreHouseRgCount int Output , @PreHouseRgArea numeric(18,2) Output ,@PreHouseRgZzCount int Output , @PreHouseRgZzArea numeric(18,2) Output ,
@PreHouseCount int Output , @PreHouseArea numeric(18,2) Output ,@PreHouseZzCount int Output , @PreHouseZzArea numeric(18,2) Output ,
@HouseRgCount int Output , @HouseRgArea numeric(18,2) Output ,@HouseRgZzCount int Output , @HouseRgZzArea numeric(18,2) Output ,
@HouseCount int Output , @HouseArea numeric(18,2) Output ,@HouseZzCount int Output , @HouseZzArea numeric(18,2) Output asSELECT @AllowPreCount= COUNT(1) , @AllPreArea= SUM(YJZMJ)
FROM FWQK
WHERE (SFXYBA = '是') AND (ISNULL(cdid, 0) = 0)
下略应该是没有过错的啊,老是提示没有输入参加,我都要疯了,请大家帮忙。谢谢
解决方案 »
- 一个基于form认证的问题
- html编辑器问题
- 回应:今天面试了二个1975年前出生的程序员,颇有一些感慨。什么东西啊!?
- 类的调用!高手指点……今天第一次想在我的网站调用一下类,结果还是没成功。请教各位!这样该怎么做?
- 大家看一条语句啊.急!
- 请问2000专业版为什么装不上SQLSERVER服务器端?
- 关于创建文件夹的问题,急????
- 大侠们救命:我用ACCESS数据库,用VBSCRIPT,数据量一大,查询时出奇的慢,经常断线报错,有什么解决的办法没有,ASP。NET页面能否先编译
- 母版页应用中 我在内容页上添加了gridview控件,在内容页的load事件中 绑定后缺获取不到列数
- 关于中文版vs.net中F1的问题.
- 江西老表,有搞.NET的朋友请进这个群32354605
- 我往项目里添国页面的时候不知道为什么没有后台代码啦。
大 public static SqlDataReader TongJi()
{
SqlParameter[] param = new SqlParameter[30]; param[0] = new SqlParameter("@AllowPreCount", 0);
param[1] = new SqlParameter("@AllPreArea", 0);
param[2] = new SqlParameter("@AllowPreZzCount", 0);
……
……
foreach(SqlParameter pra in param)
{
pra.Direction=ParameterDirection.Output;
}
return VisitBeiAn.RunDataReaderProceParam("WebStat", param);}
param[1] = new SqlParameter("@AllPreArea", SqlDbType.Int,4);
param[2] = new SqlParameter("@AllowPreZzCount", SqlDbType.Int,4);
param[3] = new SqlParameter("@AllPreZzArea", SqlDbType.Int,4);
param[4] = new SqlParameter("@AllowCount", SqlDbType.Int,4);
param[5] = new SqlParameter("@AllArea", SqlDbType.Int,4);
......
param[0].Direction=ParameterDirection.Output;
param[1].Direction=ParameterDirection.Output;
param[2].Direction=ParameterDirection.Output;
param[3].Direction=ParameterDirection.Output;
param[4].Direction=ParameterDirection.Output;
param[5].Direction=ParameterDirection.Output;
.......