Ahmed
Ahmed

Reputation: 7238

Is there a problem when I call SqlAdapter.Update and at the same time call SqlDataReader.Read

I have two applications, one updates a single table which has constant number of rows (128 rows) using SqlDataAdapter.Update method , and another application that select from this table periodically using SqlDataReader.

sometimes the DataReader returns only 127 rows not 128, and the update application does not remove or even insert any new rows, it just update.

I am asking what is the cause of this behaviour?

Upvotes: 0

Views: 412

Answers (1)

kemiller2002
kemiller2002

Reputation: 115488

Yep, datareader requires an open connection and doesn't pull all the rows at the time the query was opened so you are pulling data real time from the server. This is unlike the DataTable which queries and puts all the information in a cached object (disconnected recordset).

Upvotes: 1

Related Questions