D
Danny Ni
Hi,
I have the following VB.Net code snippet:
While datareader3.Read
..........
strsql = "select * from InspectionViolations where propTableID=" &
datareader3.Item(4) & " AND inspIDCleared IS NULL"
ConnViolPresent.Open()
CmdViolPresent = New SqlCommand(strsql, ConnViolPresent)
adapterViolPresent.SelectCommand = CmdViolPresent
adapterViolPresent.Fill(dsViolPresent)
ConnViolPresent.Close()
If (dsViolPresent.Tables(0).Rows.Count() > 0) Then
'For some reason, dsViolPresent.Tables(0).Rows.Count() always return 3
As you can see the code inside a while loop will generate a different SQL
statement and send it to SQL server. However no matter what the SQL
statement is, the result dataset stays the same and it's the result
generated by the first SQL statement.
What do I have to do to make dsViolPresent refreshed in every loop ?
TIA
I have the following VB.Net code snippet:
While datareader3.Read
..........
strsql = "select * from InspectionViolations where propTableID=" &
datareader3.Item(4) & " AND inspIDCleared IS NULL"
ConnViolPresent.Open()
CmdViolPresent = New SqlCommand(strsql, ConnViolPresent)
adapterViolPresent.SelectCommand = CmdViolPresent
adapterViolPresent.Fill(dsViolPresent)
ConnViolPresent.Close()
If (dsViolPresent.Tables(0).Rows.Count() > 0) Then
'For some reason, dsViolPresent.Tables(0).Rows.Count() always return 3
As you can see the code inside a while loop will generate a different SQL
statement and send it to SQL server. However no matter what the SQL
statement is, the result dataset stays the same and it's the result
generated by the first SQL statement.
What do I have to do to make dsViolPresent refreshed in every loop ?
TIA