Hi,
I am totally breaking my head on this.It might seem quite simple to u guys.So please help me. i am very very new to asp .net.
I have implemented DataSet functionality in the DAL,BAL and UI layers.
The OUTPUT should be such that when page loads data in the dataset should be populated on the grid based on the userID.
Below is my entire code:
DAL:
public class SHTemplateDA:Base.SQLDatabase
{
public DataSet GetSHTemplateListByUserDA(string strUserID)
{
SqlCommand objSqlCommand = Execute.GetCommandObject();
objSqlCommand.CommandText = "SHR_Select_TemplateListByUser";
objSqlCommand.Parameters.AddWithValue("@USER_ID",strUserID);
objSqlCommand.CommandType = CommandType.StoredProcedure;
return Execute.ExecuteDataset(objSqlCommand);
}
}
BAL:
public class SHTemplateBA : DataAccess.SHTemplateDA
{
public DataSet GetSHTemplateListByUserBA(string strUserID)
{
return GetSHTemplateListByUserDA(strUserID);
}
}
UI:
public class SHTemplateUI
{
public DataSet GetSHTemplateListByUserUI(string strUserID)
{
return new SHTemplateBA().GetSHTemplateListByUserBA(strUserID);
}
}
aspx.cs(linking UI layer with the code file):
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.LoadTemplateList();
}
}
public void LoadTemplateList()
{
Session["USERID"] = "XYZ";
SHTemplateUI myobj = new SHTemplateUI();
this.rgTemplateList.DataSource = myobj.GetSHTemplateListByUserUI(Convert.ToString(Session["USERID"]));
this.rgTemplateList.DataBind();
}
I am not able to populate data in the grid. Please advise me the changes that i have to do in this. Any help would be appreciated.
Thanks,
Arun