none
how can we use sqldataraeder for multiple columns? RRS feed

  • Question

  • I have more than 250 columns in output how can i use sqldatareader to get an array as output?
    Thursday, June 6, 2019 6:55 AM

All replies

  • An SqlDataReader reads the data one row at a time.   

    not sure what you mean by array as output

    Thursday, June 6, 2019 8:42 AM
  • Any other way ?

    for e.g

    Select * from table => this is query it contains almost 250 columns 

    derived result will be a lot of any data type 

    this result I want to store in array

    Thursday, June 6, 2019 8:46 AM
  • I have more than 250 columns in output how can i use sqldatareader to get an array as output?

    Maybe define an array:

       object [ ]  data = new object[259],

    then execute “SELECT * FROM…” and use ‘myReader.GetValues( data )’ or ‘myReader.GetSqlValues( data )’ for each row.


    • Edited by Viorel_MVP Thursday, June 6, 2019 6:05 PM
    Thursday, June 6, 2019 6:04 PM