hi,
The below is the code to bind the year and quarter in the form. it is working now.
protected void Page_Load(object sender, EventArgs e)
{
lblError.Text = "";
username = Context.User.Identity.Name.Replace("SASKEN\\", "");
try
{
if (!IsPostBack){
btnSubmit.Enabled =
false; string Closed_Date = ""; SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["ConnString"].ToString()); SqlCommand cmd = new SqlCommand("HRN_SP_CheckDateClosed", conn);cmd.CommandType =
CommandType.StoredProcedure;cmd.Parameters.AddWithValue(
"@HRN_Clsdate", Closed_Date); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet();da.Fill(ds);
conn.Open();
SqlDataReader DR_ClsDate = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (DR_ClsDate != null){
if (DR_ClsDate.Read()){
Closed_Date = DR_ClsDate[0].ToString();
pnlAOQ.Visible =
true;lblYear.Text = Session[
"HRN_Year"].ToString();lblQtr.Text = Session[
"HRN_Qtr"].ToString();}
else{
pnlAOQ.Visible =
false;lblError.Text =
"Award period is closed.";}
}
}
}
catch (Exception ex){
lblError.Text = ex.Message;
lblError.Visible =
true;}
finally{
conn.Close();
}
}
can anybody help on this?
Rgds,
Geetha
SreekanthPosted Apr 21, 2009, 6:39 AM
still ur quetn is not clear?
bu when ur (select data from table) and then bind to datagrid.
select 'session["year"]' from ANYTABLE
will show the Year.
like when session["year"]=2008
2008
2008
2008 depend on rows.
Geetha SeetharamaiahPosted Apr 21, 2009, 5:40 AM
Hi,
i need to bind the year and quarter from one more page depending on the date.
Rgds,
Geetha
Geetha SeetharamaiahPosted Apr 21, 2009, 5:39 AM
Hi,
i need to bind the year and quarter from one more page depending on the date.
Rgds,
Geetha
SreekanthPosted Apr 21, 2009, 5:23 AM
close ur datareader
before closing connection.
if not
wat ur error?
Sateesh ArvetiPosted Apr 21, 2009, 5:15 AM