ADO.NET/SQL Mystery

P

Perley

In using two different SQL Database server (one for
development and one for production) a call to a stored
procedure is storing incorrect data. We use ADO.NET SQL
Data Adpaters and have set the stored procedure
parameters. Tracing through on the debugger shows the
correct data in the dataset but the SQL Profiler shows
that the second parameters is coming in as a -1 (which is
not the data in the dataset). To make matters worse this
only occurs on the Development sever with the production
server executing without error.

What could be the difference in the two servers that
parses the ADO.NET interface parameters?
 
W

William \(Bill\) Vaughn

The code being executed is not the same as the code you're testing with?

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
P

Patrice Scribe

Not having the same pramater probably explians the different result set...

Now it would interesting to see from where comes this parameter (another
query ?). Most of these problems are likely related to different data.

Patrice
 
P

Perley

Source code in both case (development and Production) is
exactly the same. Have triple checked the stored
procedures and table definitions on the two servers and
they match extactly.
 
P

Perley

This was my orginal thought. The parameter that is
failing is a index number returned on saving the the
parent data record. As stated the debugger shows the data
has been updated when looking at the dataset prior to the
call to the Data Adapter interface to store the
information.

Matters have gotten even more interesting since this code
is within a wizard to process forms. On the first pass
through the error occurs if you run through the wizard a
second time (no unload load since the wizard runs
circularly) the data is stored correctely. All of this is
only against the development server and both cases perform
correctly on the production server.

It appears to be an ADO.NET error in extracting the data
from the DataSet since I performed a test using a foreach
DataRow in the appropriate table and found that the data
loaded into the local (foreach) DataRow is wrong (contains
the -1). But the question remains if it is a extracting
problem in ADO.NET why does it work in all other cases.
 

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

Top