V
vncntj
I'm trying to passing the Session["Locations"] value back to the store
procedure, but I'm having difficulty understanding stored procedures
and parameters. What I'm trying to accomplish is to have the Session
variable passed through as a parameter to the Stored Procedure where I
can test to see if any records exist? if no record exist then we can
move to the next page.
thanks,
protected void btnNext_Click(object sender, EventArgs e)
{
Session["Locations"] = Locations.Text;
Server.Transfer("AudioVisual.aspx");
/* Calling on Stored Procedure */
string connectionStr =
@"server=localhost;uid="";pwd="";trusted_connection=true;database=PMAEvents";
SqlConnection connectObj = new SqlConnection(connectionStr);
SqlCommand commandObj = new SqlCommand("eventtest",
connectionStr);
commandObj.CommandType.StoredProcedure;
commandObj.Parameters.Add(new
SqlParameter("@Locations",Session["Locations"]));
if( recordreturned == 0 )
{
Server.Transfer("nextpage.aspx");
}
else{
//Stay on the same page!!!!
}
procedure, but I'm having difficulty understanding stored procedures
and parameters. What I'm trying to accomplish is to have the Session
variable passed through as a parameter to the Stored Procedure where I
can test to see if any records exist? if no record exist then we can
move to the next page.
thanks,
protected void btnNext_Click(object sender, EventArgs e)
{
Session["Locations"] = Locations.Text;
Server.Transfer("AudioVisual.aspx");
/* Calling on Stored Procedure */
string connectionStr =
@"server=localhost;uid="";pwd="";trusted_connection=true;database=PMAEvents";
SqlConnection connectObj = new SqlConnection(connectionStr);
SqlCommand commandObj = new SqlCommand("eventtest",
connectionStr);
commandObj.CommandType.StoredProcedure;
commandObj.Parameters.Add(new
SqlParameter("@Locations",Session["Locations"]));
if( recordreturned == 0 )
{
Server.Transfer("nextpage.aspx");
}
else{
//Stay on the same page!!!!
}