I am working on a button that will execute a stored procedure. When the data is returned I only needed the record number to be passed into an array which will later be used for the back page. The backpage for the aspx will then input the record number into a string and will redirect the user to the RecordInfo page. Here is what I have so far but I keep getting the same error:
{"An SqlParameter with ParameterName '@RecNum_OUT' is not contained by this SqlParameterCollection."}
I hope you can assist me.
<asp:Button ID="GetNextRec" runat="server" Text="Get Part"
onclick="GetNextRec_Click" OnCommand="btnNext_OnClick" />
ASPX.CS
protected void GetNextRec_Click(object sender, EventArgs e)
{
String[] q = new String[1];
q = Record.GetNextRec();
Response.Redirect("~/PartsRecord.aspx?mode=full&queue=" + q[0], false);
}
Database cs
public static String[] GetNextRec()
{
Database db = DataFactory.CreateDatabase();
DbCommand dbc = db.GetProc("GetNextRec");
db.ExecuteNonQuery(dbc); // IDK if this si doing anything
String[] q = new string[1];
q[0] = dbc.Parameters["@RecNum_OUT"].Value.ToString(); // "An SqlParameter with ParameterName '@requisition_OUT' is not contained by this SqlParameterCollection."}
return q;
}