passing the parameters from other page

Apr 10 2009 7:24 AM

hi,

 

The below is the code for the one my project.

 

protected void Page_Load(object sender, EventArgs e)

{

lblerr.Text = "";

username = Context.User.Identity.Name.Replace("SASKEN\\", "");

try

{

if (!IsPostBack)

{

string Closed_Date = "";

int cmp = 0;

SqlConnection conn = new SqlConnection();

SqlCommand cmd = new SqlCommand();

CultureInfo ci = new CultureInfo("en-GB", true);

conn.ConnectionString = connstr;

cmd.Connection = conn;

cmd.CommandText = "HRN_SP_CheckDateClosed";

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.AddWithValue("@HRN_Yr", "" );

cmd.Parameters.AddWithValue("@HRN_Qtr", "" );

conn.Open();

SqlDataReader DR_ClsDate = cmd.ExecuteReader(CommandBehavior.CloseConnection);

if (DR_ClsDate != null)

{

if (DR_ClsDate.Read())

{

Closed_Date = DR_ClsDate[0].ToString();

}

}

if (Closed_Date != "")

{

DateTime DT1 = Convert.ToDateTime(Closed_Date);

cmp = DateTime.Compare(DateTime.Now, DT1);

}

if (cmp <= 0)

{

pnlTOQ.Visible = true;

}

else

{

pnlTOQ.Visible = false;

lblerr.Text = "Award period is closed.";

}

}

}

catch (Exception ex)

{

lblerr.Text = ex.Message;

lblerr.Visible = true;

}

finally

{

conn.Close();

}

}

 

for the year and quarter, i need to pass the parameters from the other page. 

 

Please help me what i need to pass for the same.

 

Regards,

Geetha


Answers (2)