c# - Better way of reading and accumulating data from sql -


i'm working through possibilities of reading data c# sql, , i'm sure better ways exist.

what have (fairly complex) sql select statement returns 3 columns. eg. personnel id, taskid , hoursworked

what want do, populate table 2 columns , data should like:

col1     |   col2 --------------------- "john"   |   "tsk01 (2 hours), tsk02 (7 hours), tsk03 (4 hours)"  "peter"  |   "tsk01 (4 hours), tsk03 (2 hours), tsk04 (3 hours)" 

so, 1 obvious way put sql statement in data reader (sorted person), iterate through , write data second table every time new person. feels cumbersome. there must easier way?

it cumbersome , inefficient.

there considerations here should make:

  • do not violate atomicity of database fields. 1 piece of information per field.
  • let database engine work before fetch data code

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -