Jump to content

Revista PROGRAMAR

  • entries
    199
  • comment
    1
  • views
    150,511

Contributors to this blog

De List para DataTable em 30 + 2 linhas!


staff

952 views

 Share

Não será de todo estranho, pelo menos para alguns, a necessidade de converter uma lista de um dado tipo para Data- table, em C#. O mais comum, seria criar um novo objecto do tipo DataTable, criar as colunas e iterar a lista, adicionando as linhas ao datatable, a cada iteração. Isto seria no mínimo trabalhoso, além de pouco eficiente. O código seria pouco elegante e semelhante ao seguinte:

Ler mais…


 Share

0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.