SqlDataAdapter missing rows?

I wrote a stored procedure in sql 2005 that returns 14 rows when I run it directly from management studio.  When I call the same stored procedure from .net with the same parameter, it returns 13 rows.   I'm using SqlDataAdapter and have never had a problem like this with it before.  Any suggestions?  Nothing stands out with the one missing row.  It's pretty much in the middle of the dataset with simliar data as the rest of the rows (but different enough to not be excluded in a SELECT DISTINCT).
sqlConnection = new SqlConnection(SQLCONNECTIONSTR);
            sqlConnection.Open();
 
            DataTable dtOrderData = new DataTable();
            SqlCommand cmd = new SqlCommand("TestingSTP", sqlConnection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Parameter1", SqlDbType.Int).Value = cartData.ClientID;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dtOrderData);

Open in new window

LVL 1
collagesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

strickddCommented:
I would recommend either debugging and stepping through the code you posted. Make sure the values you are passing to the stored procedure are what you expect. Also execute the stored procedure through management studio (NOT just the SQL statement in the stored procedure).

You can alternatively set up a SQL trace and see what is being received and returned, but your user may need special permissions on the db.

Remember, don't assume, VERIFY.
0
collagesAuthor Commented:
I tried a sql trace and it didnt reveal anything I didn't know.   I also tried stepping through the .net debugger and everything was correct, except that the row count for the datatable was 13, whereas the rows returned in management studio was 14.
0
collagesAuthor Commented:
I tracked the problem down.  A stp was being run later in the c# code that affected the table.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.