Skip to content

Instantly share code, notes, and snippets.

@MayogaX
Created November 8, 2012 23:38
Show Gist options
  • Select an option

  • Save MayogaX/4042635 to your computer and use it in GitHub Desktop.

Select an option

Save MayogaX/4042635 to your computer and use it in GitHub Desktop.
Exemplo List populada por dataReader
List<MinahClasse> lista = new List<MinhaClasse>();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
MinhaClasse classe = new MinhaClasse();
classe.propriedade = reader["propriedade"].ToString();
classe.total = Convert.Toint32(reader["total"]);
lista.Add(classe);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment