Mat,
>System.Data.IDataReader does not contain a definition for ItemThat's because you're using the Interface (IDataReader) rather than OleDbDataReader or SqlDataReader (sorry, I didn't notice that in your original post). It seems strange that they wouldn't have the Item property in the Interface, but it doesn't look like it's there. Do you need to use IDataReader or can you use either the OleDb or Sql DataReader?
~~Bonnie
>Bonnie,
>
>Thank you for the reply! I thought I could do something like this, but if I try dr.Item[0] I get the following compile error:
>
>System.Data.IDataReader does not contain a definition for Item
>
>I have looked through the help files and a couple of books I have, but I can find the correct syntax.
>
>Kind Regards,
>
>Mat
>
>>
>>I haven't used a DataReader, but based on how stuff works with DataSets, I bet you probably have to do something like this:
>>
>>IDataReader dr = this.ExecReader(SelectCmd, out conn);
>>while (dr.Read())
>>{
>> if (dr.Item[0] != DBNull.Value)
>> MyString = dr.GetString(0);
>>}
>>
>>Something like that anyway ... I'm not sure of the syntax and I haven't actually tried it, but see if something along these lines would work for you.
>>
>>~~Bonnie
>>