I\'m using a SqlDataReader
and get this exception when trying to read a column...
System.IndexOutOfRangeException: record
>
That's because you have no field named "record", you aliased it to "CUSTOMER_NO" so change the code to:
lblWebMasterMessage.Text += "record " + reader["CUSTOMER_NO"].ToString() + "
";
That said, you can also use index instead of name so to read the second column:
lblWebMasterMessage.Text += "record " + reader[1] + "
";