Showing posts with label accessing. Show all posts
Showing posts with label accessing. Show all posts

Wednesday, March 21, 2012

Odd results from query

The environment is ASP.Net accessing the SQL server through IIS.
While, I've been told that .Net does not create a cache the behavior I'm
observing for intensive purposes looks as if there is a cache. I'm at a bit
of a loss to explain this behavior. Also, if I wait five or ten minutes, and
refresh I get the correct value.
I have a stored procdure that returns a series of rows, from which I sum a
particular number.
There is an action which causes another row to be added.
However, when I make this change to the database the change is not returned
in a query immediatly following the update. I have simultaneously run sql
query analyzer and verified that the table was updated correctly.
When the form is first displayed and then shortly after I perfomr the update
the value 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 would very much like to get the correct result right away.
Thanks,
Dave
I think you should share more details about the nature of your stored proc.
Are any parameters being passed to the procedure? When you say 5 or 10
minutes have passed before it returns the correct sum, are you using the same
active browser window, or are you starting a new browser (thus starting a new
session, and perhaps refreshing the state with the server, thus passing new
parameters to the procedure).
Just a guess - I'm probably way off and you probably already thought of all
that
Brian
"Dave" wrote:

> The environment is ASP.Net accessing the SQL server through IIS.
> While, I've been told that .Net does not create a cache the behavior I'm
> observing for intensive purposes looks as if there is a cache. I'm at a bit
> of a loss to explain this behavior. Also, if I wait five or ten minutes, and
> refresh I get the correct value.
> I have a stored procdure that returns a series of rows, from which I sum a
> particular number.
> There is an action which causes another row to be added.
> However, when I make this change to the database the change is not returned
> in a query immediatly following the update. I have simultaneously run sql
> query analyzer and verified that the table was updated correctly.
> When the form is first displayed and then shortly after I perfomr the update
> the value 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 would very much like to get the correct result right away.
> Thanks,
> Dave
sql

Monday, March 12, 2012

ODBC, Excel, SQL Server

I have a user accessing SQL Server 2000 data through Excel
and MSQuery...we have used ODBC DSN with no probs. It is
only this user with an issue, so very specific to their
setup somehow.
Example databases called A and B.
User had ODBC DSN set up to default database A.
We want it to be B.
Edited DSN to have default database of B.
No prob. Saved, verified, successful. Just like in past.
HOWEVER, when creating a NEW Excel spreadsheet and NEW DB
Query using this DSN, it STILL points to database A for
some reason. There are no other DSNs with this name
(system, file, or user).
Any idea why it is pointing to the old db, and WHERE it is
getting this from? I have tried removing the DSN and
recreating it. I have tried using other people's logins
instead of his. This works fine on any other computer we
try it on.
Perplexed,
Sharon
I think this might be caused by using an Excel data source that points to
the old ODBC DSN. Excel builds its own wrapper for ODBC data sources and
typically stores them as .odc files. These are separate entries from the
ODBC data source that you build using the ODBC Administrator. Try opening
Excel, using the Data | Import External Data | Import Data option to display
the Select Data Source dialog. Then delete the old data source by right
clicking on it and selecting Delete from the pop-up menu. Once the old Excel
data source file is deleted build a new one by clicking the New Source
button and following the wizard dialogs.
Mike O.
"Sharon" <beall2@.llnl.gov> wrote in message
news:12e3201c411fc$714a9300$a301280a@.phx.gbl...
> I have a user accessing SQL Server 2000 data through Excel
> and MSQuery...we have used ODBC DSN with no probs. It is
> only this user with an issue, so very specific to their
> setup somehow.
> Example databases called A and B.
> User had ODBC DSN set up to default database A.
> We want it to be B.
> Edited DSN to have default database of B.
> No prob. Saved, verified, successful. Just like in past.
> HOWEVER, when creating a NEW Excel spreadsheet and NEW DB
> Query using this DSN, it STILL points to database A for
> some reason. There are no other DSNs with this name
> (system, file, or user).
> Any idea why it is pointing to the old db, and WHERE it is
> getting this from? I have tried removing the DSN and
> recreating it. I have tried using other people's logins
> instead of his. This works fine on any other computer we
> try it on.
> Perplexed,
> Sharon
>

ODBC, Excel, SQL Server

I have a user accessing SQL Server 2000 data through Excel
and MSQuery...we have used ODBC DSN with no probs. It is
only this user with an issue, so very specific to their
setup somehow.
Example databases called A and B.
User had ODBC DSN set up to default database A.
We want it to be B.
Edited DSN to have default database of B.
No prob. Saved, verified, successful. Just like in past.
HOWEVER, when creating a NEW Excel spreadsheet and NEW DB
Query using this DSN, it STILL points to database A for
some reason. There are no other DSNs with this name
(system, file, or user).
Any idea why it is pointing to the old db, and WHERE it is
getting this from? I have tried removing the DSN and
recreating it. I have tried using other people's logins
instead of his. This works fine on any other computer we
try it on.
Perplexed,
SharonI think this might be caused by using an Excel data source that points to
the old ODBC DSN. Excel builds its own wrapper for ODBC data sources and
typically stores them as .odc files. These are separate entries from the
ODBC data source that you build using the ODBC Administrator. Try opening
Excel, using the Data | Import External Data | Import Data option to display
the Select Data Source dialog. Then delete the old data source by right
clicking on it and selecting Delete from the pop-up menu. Once the old Excel
data source file is deleted build a new one by clicking the New Source
button and following the wizard dialogs.
Mike O.
"Sharon" <beall2@.llnl.gov> wrote in message
news:12e3201c411fc$714a9300$a301280a@.phx
.gbl...
> I have a user accessing SQL Server 2000 data through Excel
> and MSQuery...we have used ODBC DSN with no probs. It is
> only this user with an issue, so very specific to their
> setup somehow.
> Example databases called A and B.
> User had ODBC DSN set up to default database A.
> We want it to be B.
> Edited DSN to have default database of B.
> No prob. Saved, verified, successful. Just like in past.
> HOWEVER, when creating a NEW Excel spreadsheet and NEW DB
> Query using this DSN, it STILL points to database A for
> some reason. There are no other DSNs with this name
> (system, file, or user).
> Any idea why it is pointing to the old db, and WHERE it is
> getting this from? I have tried removing the DSN and
> recreating it. I have tried using other people's logins
> instead of his. This works fine on any other computer we
> try it on.
> Perplexed,
> Sharon
>