citizenzen
Programmer
Hi.
I am trying to work with sessions so that I can transfer info from page1.aspx.cs to page2.aspx.
the results of the dataset on page1.aspx may have more than one value per assigned variable. however, I am not getting this on page 2. only one resulty is displayed and the datagrid does not show.
1) how can I show the values correctly on page 2? i place the session fields in the page_load
2) i pulled over a datagrid on the presentation page
=================================
//page 1
protected void checkoutItembtn_Click(object sender, EventArgs e)
{
//variables to send to libCheckout Page
int intRequestout;
int intUserIDout;
string struserout;
int intTapeIDout;
string strBarcodeout = "0";
int intVideoout = 0;
string strVideoout = "0";
int intShowout = 0;
string strShowout = "0";
int intElementout = 0;
int intstatusout = 0;
string strLibraryout = "0";
int intShelfnumout = 0;
string strShelfout = "0";
string processact = ConfigurationManager.ConnectionStrings["RevisedTapeLibrary"].ConnectionString;
SqlConnection chkoutconn = new SqlConnection(processact);
//int intmedia= Convert.ToInt32(approvGrid.SelectedValue);
int intstep = Convert.ToInt32(approvGrid.SelectedValue);
SqlCommand chkoutcomm = new SqlCommand("select * from view_locMatchedBarcodeReqs WHERE SubNum=" + intstep, chkoutconn);
chkoutconn.Open();
SqlDataReader chkRead = chkoutcomm.ExecuteReader();
if (chkRead.HasRows)
{
while (chkRead.Read())
{
intRequestout = (int)chkRead["Request"];
intUserIDout = (int)chkRead["UserID"];
struserout = (string)chkRead["Name"];
intTapeIDout = (int)chkRead["ItemID"];
//intTapeIDout += intTapeIDouty;
if (chkRead["MatchedBarcode"] != DBNull.Value)
{ strBarcodeout = (string)chkRead["MatchedBarcode"]; }
if(chkRead["MusicID"]!=DBNull.Value)
{ intVideoout = (int)chkRead["MusicID"]; }
if (chkRead["Video"] != DBNull.Value)
{ strVideoout = (string)chkRead["Video"]; }
if (chkRead["ShowID"] != DBNull.Value)
{ intShowout = (int)chkRead["ShowID"]; }
if (chkRead["Show"] != DBNull.Value)
{ strShowout = (string)chkRead["Show"]; }
if (chkRead["ElementNumber"] != DBNull.Value)
{ intElementout = (int)chkRead["ElementNumber"]; }
if (chkRead["StatusID"] != DBNull.Value)
{ intstatusout = (int)chkRead["StatusID"]; }
if (chkRead["Library"] != DBNull.Value)
{ strLibraryout = (string)chkRead["Library"]; }
if (chkRead["ShelfNum"] != DBNull.Value)
{ intShelfnumout = (int)chkRead["ShelfNum"]; }
if (chkRead["Shelf Name"] != DBNull.Value)
{ strShelfout = (string)chkRead["Shelf Name"]; }//strShelfout
Session.Add("Request", intRequestout);
Session.Add("UserID", intUserIDout);
Session.Add("User", struserout);
Session.Add("TapeID", intTapeIDout);
Session.Add("Barcode", strBarcodeout);
Session.Add("VideoNum", intVideoout);
Session.Add("Video", strVideoout);
Session.Add("ShowNum", intShowout);
Session.Add("ShowTitle", strShowout);
Session.Add("EleNum", intElementout);
Session.Add("StatusNum", intstatusout);
Session.Add("Library", strLibraryout);
Session.Add("ShelfNum", intShelfnumout);
Session.Add("Shelf", strShelfout);
}
}
Server.Transfer("~/libCheckoutTape.aspx");//if item has been dubbed, enable buttons
chkoutconn.Close();
}
=================================
page 2 (in page load)
int req = (int)(Session["Request"]);
int userid = (int)(Session["UserID"]);
string user = (string)(Session["User"]);
int tapeid = (int)(Session["TapeID"]);
string bcodes = (string)(Session["Barcode"]);
int videoid = (int)(Session["VideoNum"]);
string vid = (string)(Session["Video"]);
int showid = (int)(Session["ShowNum"]);
string show = (string)(Session["ShowTitle"]);
int eleid = (int)(Session["EleNum"]);
int statusid = (int)(Session["StatusNum"]);
string lib = (string)(Session["Library"]);
int shelfid = (int)(Session["ShelfNum"]);
string shelf = (string)(Session["Shelf"]);
I am trying to work with sessions so that I can transfer info from page1.aspx.cs to page2.aspx.
the results of the dataset on page1.aspx may have more than one value per assigned variable. however, I am not getting this on page 2. only one resulty is displayed and the datagrid does not show.
1) how can I show the values correctly on page 2? i place the session fields in the page_load
2) i pulled over a datagrid on the presentation page
=================================
//page 1
protected void checkoutItembtn_Click(object sender, EventArgs e)
{
//variables to send to libCheckout Page
int intRequestout;
int intUserIDout;
string struserout;
int intTapeIDout;
string strBarcodeout = "0";
int intVideoout = 0;
string strVideoout = "0";
int intShowout = 0;
string strShowout = "0";
int intElementout = 0;
int intstatusout = 0;
string strLibraryout = "0";
int intShelfnumout = 0;
string strShelfout = "0";
string processact = ConfigurationManager.ConnectionStrings["RevisedTapeLibrary"].ConnectionString;
SqlConnection chkoutconn = new SqlConnection(processact);
//int intmedia= Convert.ToInt32(approvGrid.SelectedValue);
int intstep = Convert.ToInt32(approvGrid.SelectedValue);
SqlCommand chkoutcomm = new SqlCommand("select * from view_locMatchedBarcodeReqs WHERE SubNum=" + intstep, chkoutconn);
chkoutconn.Open();
SqlDataReader chkRead = chkoutcomm.ExecuteReader();
if (chkRead.HasRows)
{
while (chkRead.Read())
{
intRequestout = (int)chkRead["Request"];
intUserIDout = (int)chkRead["UserID"];
struserout = (string)chkRead["Name"];
intTapeIDout = (int)chkRead["ItemID"];
//intTapeIDout += intTapeIDouty;
if (chkRead["MatchedBarcode"] != DBNull.Value)
{ strBarcodeout = (string)chkRead["MatchedBarcode"]; }
if(chkRead["MusicID"]!=DBNull.Value)
{ intVideoout = (int)chkRead["MusicID"]; }
if (chkRead["Video"] != DBNull.Value)
{ strVideoout = (string)chkRead["Video"]; }
if (chkRead["ShowID"] != DBNull.Value)
{ intShowout = (int)chkRead["ShowID"]; }
if (chkRead["Show"] != DBNull.Value)
{ strShowout = (string)chkRead["Show"]; }
if (chkRead["ElementNumber"] != DBNull.Value)
{ intElementout = (int)chkRead["ElementNumber"]; }
if (chkRead["StatusID"] != DBNull.Value)
{ intstatusout = (int)chkRead["StatusID"]; }
if (chkRead["Library"] != DBNull.Value)
{ strLibraryout = (string)chkRead["Library"]; }
if (chkRead["ShelfNum"] != DBNull.Value)
{ intShelfnumout = (int)chkRead["ShelfNum"]; }
if (chkRead["Shelf Name"] != DBNull.Value)
{ strShelfout = (string)chkRead["Shelf Name"]; }//strShelfout
Session.Add("Request", intRequestout);
Session.Add("UserID", intUserIDout);
Session.Add("User", struserout);
Session.Add("TapeID", intTapeIDout);
Session.Add("Barcode", strBarcodeout);
Session.Add("VideoNum", intVideoout);
Session.Add("Video", strVideoout);
Session.Add("ShowNum", intShowout);
Session.Add("ShowTitle", strShowout);
Session.Add("EleNum", intElementout);
Session.Add("StatusNum", intstatusout);
Session.Add("Library", strLibraryout);
Session.Add("ShelfNum", intShelfnumout);
Session.Add("Shelf", strShelfout);
}
}
Server.Transfer("~/libCheckoutTape.aspx");//if item has been dubbed, enable buttons
chkoutconn.Close();
}
=================================
page 2 (in page load)
int req = (int)(Session["Request"]);
int userid = (int)(Session["UserID"]);
string user = (string)(Session["User"]);
int tapeid = (int)(Session["TapeID"]);
string bcodes = (string)(Session["Barcode"]);
int videoid = (int)(Session["VideoNum"]);
string vid = (string)(Session["Video"]);
int showid = (int)(Session["ShowNum"]);
string show = (string)(Session["ShowTitle"]);
int eleid = (int)(Session["EleNum"]);
int statusid = (int)(Session["StatusNum"]);
string lib = (string)(Session["Library"]);
int shelfid = (int)(Session["ShelfNum"]);
string shelf = (string)(Session["Shelf"]);