are you know the difference between this two condition
1
if(reader.hasrows())
{
while(reader.read())
{
}
}
2
while(reader.read())
{
if(reader.hasrows())
{
}
}
are you know the difference between this two condition
1
if(reader.hasrows())
{
while(reader.read())
{
}
}
2
while(reader.read())
{
if(reader.hasrows())
{
}
}
Doing if/while or while/if is not necessary, since "while(reader.read())" will only return true when the reader has rows "hasrows()" and has a row to read "read()". The extra nesting has no value.