Results 1 to 3 of 3

Thread: DataReader

  1. #1
    Join Date
    Dec 1969

    Default DataReader

    Hmm!<BR><BR>You may fetch for instance an Integer by specifying the column number like this:<BR><BR>myDataReader.GetInt32(2)<BR><BR>.. but you cant fetch the Integer by specifying the column name:<BR><BR>myDataReader.GetInt32("col_name")<BR> <BR>What&#039;s up with this?<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default That's how it works.

    The parameter that that method accepts is the the ordinal of the column, which, of course, comes in Int form. It won&#039;t accept a string representing the column name. Or any string, for that matter.

  3. #3
    Join Date
    Dec 1969

    Default RE: DataReader

    You can use the GetOrdinal method to get around this. It would look something like this:<BR><BR>myDataReader.GetInt32( myDataReader.GetOrdinal("col_name") )<BR>

Posting Permissions

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