Jay
Sun Jan 21 17:49:41 CST 2007
John,
Have you tried:
> Console.WriteLine("{0}", Reader.GetOrdinal("Last Staff Update From Site"))
Generally this is why I avoid including spaces in field names...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"John" <John@nospam.infovis.co.uk> wrote in message
news:OzpeTnZPHHA.4484@TK2MSFTNGP02.phx.gbl...
> Hi
>
> I am getting the System.IndexOutOfRangeException was unhandled error on
> the last line of below code;
>
> Cmd = New OleDb.OleDbCommand("SELECT [Last Staff Update From Site] FROM
> [Update Control]", LocalConn)
> Reader = Cmd.ExecuteReader()
> Console.WriteLine("{0}", Reader.GetOrdinal("[Last Staff Update From
> Site]"))
>
> What is the problem and how can I fix it?
>
> Thanks
>
> Regards
>
>