-1
Hi! I am reading values from a table and inserting them into a list. What I have is this:
Expiração.Add(rdr["Name" + "Address"].ToString());
Expiração.Add(rdr["Address"].ToString());
Expiração.Add(rdr["PostalCode"].ToString());
Expiração.Add(rdr["PostalCodeDesc"].ToString());
Expiração.Add(rdr["NIF"].ToString());
Expiração.Add(rdr["eMail"].ToString());
Expiração.Add(rdr["Phone"].ToString());
Expiração.Add(rdr["ContactPerson"].ToString());
Expiração.Add(rdr["Machine"].ToString());
Expiração.Add(rdr["RegistrationDate"].ToString());
But so I’m adding several items to the list, what I wanted was to add just one item with all that information, something like that (just example, why doesn’t it work):
Expiração.Add(rdr["Name" + "Address" + "PostalCode" + ...].ToString());
What you have to do is create a class that is composed of the table columns. From there you create a List of this class: ex: List<Classname>. If you have any questions about the code to be done, say. Ps: Entityframework search
– Renato Afonso