Click here to Skip to main content
14,664,481 members
Rate this:
Please Sign up or sign in to vote.
my project is a clr (VC++) project. i want to debug and to trace my code ( in debug mode)
but as soon as i call
da->Fill(dS, L"tlbReferalPersonInfo");
then i can't see value of objects.
for example in my code bellow (in debug mode) :
int otherVal = 10;
SqlCommand^ cmd = gcnew SqlCommand(sPersonInfoRecord, objConHIS1);
cmd->CommandType = System::Data::CommandType::StoredProcedure;
cmd->Parameters->AddWithValue(L"@IDADMITClinic", nAdmitClinic);
SqlDataAdapter^ da = gcnew SqlDataAdapter(cmd);
da->SelectCommand = cmd;
da->Fill(dS, L"tlbReferalPersonInfo");


after calling Fill() function, i can't see value of "ds's members" or even the value of "otherVal"
how do i debug my code ?

why??? please help me to trace my code.

What I have tried:

i can't see Value of variables in debug mode when i call SqlDataAdapter.Fill() function!!!!
Updated 21-Jul-19 4:18am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Fill is a "blocking call" - it doesn't return until the DB has assembled all information and returned it to your application (or the SQL timeout expires, whichever happens first).
So if your stored procedure takes a long time, you can't do anything else on that thread - including use the debugger - until it is complete or timed out.

I'd suggest that you start by looking at the SP in SSMS and see what it does and how long it takes to do it ...
Zon-cpp 22-Jul-19 1:37am
no! it didn't blocked!!! the Fill() function returns and i can debug next lines. But i can't read the value of variables!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100