Results 1 to 3 of 3

Thread: datareader - number of cols

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175

    datareader - number of cols

    dir all
    I have datareader object that holds an sql (select *) result. i need to know how many columns this datagrid holds - the result of the sql is comming from access file - mabe i can retrieve this data by sql to the access file???
    thnks

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: datareader - number of cols

    All the datareaders have a FieldCount property - this should do what you want - DataReader1.FieldCount

    Also you can access the number of columns a DataGrid contains - DataGrid1.Columns.Count

    HTH

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175

    Re: datareader - number of cols

    thnks alot - you helped me
    the FieldCount is better for me because im generating script to the client in the server and i don use datagrid to show data.
    Thnks alot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width