I have this statement:
if (sqlClass.Reader != null && sqlClass.Reader.HasRows)
{
do
{
data = sqlClass.Reader.GetString(0); //error line System.InvalidOperationException {"Invalid attempt to read when no data is present."}
} while (sqlClass.Reader.Read());
}
the object sqlClass.Reader is of type System.Data.SqlClient.SqlDataReader
In C# it gives me an InvalidOperationException but in VB it worked fine, what would the reason be and how do I solve this?