c# - How to access to the content of a DataRow? -


i have following problem.

i have datatable object represent single column table, column named vulnerabilityreferenceid, this:

vulnerabilityreferenceid 167554 167555 167556 167557 167558 167559 167560 167561 

so want create foreach access these row , put value variable

i have done:

foreach (datarow row in _dt.rows) {     debug.writeline("vulnerabilityreferenceid: "  ); } 

but can access value of current row , put int variable?

this approach read field , convert required datatype. requires reference datasetextension assembly net3.5 start find datarowextensions class

foreach (datarow row in _dt.rows) {     int id = row.field<int>("vulnerabilityreferenceid");     ..... } 

note: assume field vulnerabilityreferenceid of type integer


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -