SqlHelper RRS feed

  • Question

  • Thanks in advance
       I have been using Sql Helper for last few days while developing one web site.
       I have used the following method in DataAccessLayer(one cs file). Iam getting  totRecords =0 always. Please tell me where iam wrong.

    public SqlDataReader Events(int i,string cat)
            SqlParameter[] sqlParams = new SqlParameter[5];

            sqlParams[0] = new SqlParameter("@CurrentPage", SqlDbType.Int);
            sqlParams[0].Value = currentpg.ToString();

            sqlParams[1] = new SqlParameter("@PageSize", SqlDbType.Int);
            sqlParams[1].Value = 1;

            sqlParams[2] = new SqlParameter("@BISid", SqlDbType.Int);
            sqlParams[2].Value = i.ToString();

            sqlParams[3] = new SqlParameter("@category", SqlDbType.VarChar,50);
            sqlParams[3].Value = cat.ToString();
            sqlParams[4] = new SqlParameter("@TotalRecords", SqlDbType.Int);
            sqlParams[4].Direction = ParameterDirection.Output;
            totRecords = Convert.ToInt16(sqlParams[4].Value);
                dreader = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(sqlconnection,                                               CommandType.StoredProcedure, "BIS_DisplayEvents", sqlParams);
            return dreader;
    Thursday, November 8, 2007 6:11 AM

All replies


    You'll probably get a lot more help if you post this question to a forum related to ADO.NET, and not to this forum, which is dedicated to SQL Server Integration Services.
    Thursday, November 8, 2007 1:14 PM
  • Moving thread...

    Friday, November 9, 2007 6:33 AM