SqlParameter[] parameters = new SqlParameter[2]; parameters[0] = new SqlParameter("RegistrationID", RegID); parameters[1] = new SqlParameter("PersonID", 0); parameters[1].Direction = ParameterDirection.Output ;I then need to use the value of output parameter and pass it to a different function. I'm wondering what is the good way of casting the value to integer. May be I can specify it as an integer in the constructor?
GridViewRow row = null; for (int i = 0; i < this.ProfilesGrid.Rows.Count; i++ ) { row = this.ProfilesGrid.Rows[i]; CheckBox chkbtnApproved = row.FindControl("chkApproved") as CheckBox ; if (chkbtnApproved != null) { if (chkbtnApproved.Checked == true) { int RegID = (int)this.ProfilesGrid.DataKeys[i].Value ; //PersonName = row.Cells[ ["FirstName"] + " " + row["LastName"]; PersonName = "test"; //PersonName = ((TextBox)row.FindControl("FirstName")).Text + " " + ((TextBox)row.FindControl("LastName")).Text; SqlParameter[] parameters = new SqlParameter[2]; parameters[0] = new SqlParameter("RegistrationID", RegID); parameters[1] = new SqlParameter("PersonID", 0); parameters[1].Direction = ParameterDirection.Output ; //new System.Data.SqlClient.SqlParameter("RegistrationID", RegID) Util.RunStoredProc("SaveApprovedPerson", parameters); MessageText = "Dear " + PersonName + ", " + Environment.NewLine + Environment.NewLine + "Your Registration has been approved! " + Environment.NewLine + Environment.NewLine + "Welcome to ...!"; Util.SendMessage(parameters[1].Value, Membership.GetUser(), false, MessageText, "Registration Approved", System.Configuration.ConfigurationManager.AppSettings["devEmail"] ); PeopleApproved++; } } }Thanks a lot in advance.