Cache problem with SQL server

G

Guest

I have a page which displays a sum of numbers from a table.

Also on this page is a textbox and button that causes an update to the table
that will affect this sum.

However, when I make the change to the database the change is not updated on
my page. I have simultaneously run sql query analyzer and verified that the
table was updated correctly.

Each time (at page load, and then after the button has been pressed), the
code path has been verified via break points, the value is to be displayed it
is recalculated via the following mechanism:

Using the global connection string a new SqlConnection object is built. Then
a new SqlCommand object is built using the new SqlConnection. The command
type is stored procedure. After the SqlCommand is setup (the command text and
parameters filled in), a new SqlDataAdapter is built using the SqlCommand.
The SqlDataAdapter fills a new DataSet, via the Fill method.

When I say that the object is new I mean that literally, as in
SqlCommand cmd = new SqlCommand (ConnectionString);

I'm assuming by the behavior that my table was cached. So, I'm wondering
what property or method I can use that will cause my query to view the cache
as invalid and get the correct values.

Thanks,
Dave
 
B

bruce barker

..net has no caching feature for sql queries, so your diagnosis is wrong. you
must have a different problem. be sure you are not using any statics (shared
or module globals).

-- bruce (sqlwork.com)




| I have a page which displays a sum of numbers from a table.
|
| Also on this page is a textbox and button that causes an update to the
table
| that will affect this sum.
|
| However, when I make the change to the database the change is not updated
on
| my page. I have simultaneously run sql query analyzer and verified that
the
| table was updated correctly.
|
| Each time (at page load, and then after the button has been pressed), the
| code path has been verified via break points, the value is to be displayed
it
| is recalculated via the following mechanism:
|
| Using the global connection string a new SqlConnection object is built.
Then
| a new SqlCommand object is built using the new SqlConnection. The command
| type is stored procedure. After the SqlCommand is setup (the command text
and
| parameters filled in), a new SqlDataAdapter is built using the SqlCommand.
| The SqlDataAdapter fills a new DataSet, via the Fill method.
|
| When I say that the object is new I mean that literally, as in
| SqlCommand cmd = new SqlCommand (ConnectionString);
|
| I'm assuming by the behavior that my table was cached. So, I'm wondering
| what property or method I can use that will cause my query to view the
cache
| as invalid and get the correct values.
|
| Thanks,
| Dave
 
G

Guest

Well, I didn't claim that .net had established the cache. And the only global
in the entire sequence is the connection string. Everything else (all those
things I said were new) are local's.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,166
Latest member
DollyBff32
Top