Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
can u explain me line by line with comments plz
C#
List<employeeinfo> eList = new List<employeeinfo>();
EmployeeInfo objEmp = null;

DataSet ds = new DataSet();
ds.ReadXml(xmlConString);
if (ds.Tables.Count != 0)
{
   for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
   {
      objEmp = new EmployeeInfo();
      objEmp.ID = Convert.ToInt64(ds.Tables[0].Rows[i]["ID"]);
      objEmp.EmployeeCode = Convert.ToString(ds.Tables[0].Rows[i]["EmployeeCode"]);
      objEmp.EmployeeName = Convert.ToString(ds.Tables[0].Rows[i]["EmployeeName"]);
      objEmp.DepartmentId = Convert.ToInt32(ds.Tables[0].Rows[i]["DepartmentId"]);
      objEmp.DepartmentName = Convert.ToString(ds.Tables[0].Rows[i]["DepartmentName"]);
      objEmp.EmployeeGroup = Convert.ToString(ds.Tables[0].Rows[i]["EmployeeGroup"]);
      objEmp.Email = Convert.ToString(ds.Tables[0].Rows[i]["Email"]);
      objEmp.isActive = Convert.ToBoolean(ds.Tables[0].Rows[i]["isActive"]);
      eList.Add(objEmp);
Posted
Updated 11-Dec-12 6:44am
v3
Comments
choudhary.sumit 11-Dec-12 6:27am    
what are your doubts??

1 solution

No. Do you have any idea how much work explaining code line by line is?
Every single line needs a paragraph of explanation! For example:
int next = r.Next();

Create a new variable called "next" which can hold a integer value. From the previously declared Random instance "r", call the "Next" method to get a new random number, and assign it to the "next" variable.

Can you imagine how long it would take us to explain even a very short code fragment like your example, line by line?

No. It is not going to happen. If you have a specific problem, then ask a question about it. But think first - would you want to sit down for 45 minutes and type up a line-by-line description for no good reason?
 
Share this answer
 
Comments
Thomas Daniels 11-Dec-12 12:44pm    
I agree, +5!
Surendra0x2 11-Dec-12 13:31pm    
;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900