c# - Filling an array with one field of data from a DataTable -




i've got datatable data in it. simplification, i'll datatable looks this:

datatable accdt = new datatable();  string cmdtxt = "select cbl.benefit_id benefitid, "; cmdtxt = cmdtxt + "cbl.benefit_category category, cbl.benefit_provision provision, "; cmdtxt = cmdtxt + "from cstapp_o.d_benefit cbl ";  oraclecommand cmd = new oraclecommand(cmdtxt, connection); cmd.connection = connection;  cmd.commandtext = cmdtxt; cmd.commandtype = commandtype.text; oracledataadapter da = new oracledataadapter(cmd);  da.fill(accdt); 

now, want fill array values of field called "category". how go doing this?

should put column values array.

accdt.asenumerable().select(r => r.field<string>("category")).toarray(); 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -