mpho lehutso

mpho lehutso

  • NA
  • 1
  • 6.9k

keeping my procedure parameters constant

Oct 21 2010 9:10 AM
    HI 
I have a app created with visual studio 2005, the problem i have is when parsing parameters to a proc one of those parameters does not stay constant. it changes once the proc is executed from the front end, the last character is removed and a 0 is added at the end. heres the code below. 
public string adminRatePlan(
            string subEquip,
            string subId,
            string oldSimNo, 
            string simNo,
            string oldMsisdn, 
            string msisdn,
            string oldRpUid, 
            string rpuid,
            string serviceUid,
            string action,
            string oldNaUid,
            string naUid,
            string term,
            string user,
            DateTime actionDate,
            DatabaseHelper localHelper)//,string srcUid
        {
            string bs_uid1 = "";

            DataTable dtChecks = new DataTable();
            dtChecks = dtAgain(subId);

            if (dtChecks.Rows.Count > 0)
            {
                DataRow drCheck2 = dtChecks.Rows[0];
                bs_uid1 = drCheck2[1].ToString();
            }

            databaseHelper = new DatabaseHelper();
            databaseHelper.Connect();
            databaseHelper.ClearParameters();
      
            databaseHelper.AddParameter("p_se_uid", Int64.Parse(subEquip), ParameterDirection.InputOutput);
            databaseHelper.AddParameter("p_bs_uid", Int64.Parse(bs_uid1.ToString().Trim()));
            databaseHelper.AddParameter("p_old_ni_uid", Int64.Parse(oldSimNo));
            databaseHelper.AddParameter("p_ni_uid", Int64.Parse(simNo));
            databaseHelper.AddParameter("p_old_si_uid", Int64.Parse(oldMsisdn));
            databaseHelper.AddParameter("p_si_uid", Int64.Parse(msisdn));
            databaseHelper.AddParameter("p_old_na_uid", Int64.Parse(oldNaUid));
            databaseHelper.AddParameter("p_na_uid", Int64.Parse(naUid));
            databaseHelper.AddParameter("p_old_rp_uid", Int64.Parse(oldRpUid));
            databaseHelper.AddParameter("p_rp_uid", Int64.Parse(rpuid));
            databaseHelper.AddParameter("p_srv_uid", Int64.Parse(serviceUid), ParameterDirection.InputOutput);
            databaseHelper.AddParameter("p_function", action);
            /*if(srcUid != "")
            {
                databaseHelper.AddParameter("p_src_uid", int.Parse(srcUid));
            }*/
            databaseHelper.AddParameter("n_u_uid", Int64.Parse(user));
            databaseHelper.AddParameter("n_terminal", term);
            databaseHelper.AddParameter("n_action_date", DateTime.Parse(actionDate.ToString()));
            databaseHelper.AddParameter("n_error", 0, ParameterDirection.InputOutput);
            databaseHelper.AddParameter("p_message", "", ParameterDirection.InputOutput, 4000);

            databaseHelper.ExecuteNonQuery("commonfuncvxview1.adminrateplan", CommandType.StoredProcedure, false);
            string test = databaseHelper.GetParameterValue("n_error");
            test += "/";
            test += databaseHelper.GetParameterValue("p_message");
            databaseHelper.ClearParameters();
            return test;
        }

the bs_uid is 333456 but once executed it changes to 333450.

Answers (3)