Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
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) :
C++
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");

objConHIS1->Open();

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!!!!
Posted
Updated 21-Jul-19 4:18am

1 solution

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 ...
 
Share this answer
 
Comments
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900