User-939850651 posted
Hi mmm@gmail.com86,
Based on the information you have provided now, I am afraid I cannot reproduce your problem, because I am not sure what parameters are stored in your data sheet and how you operated in the test.
First, after you pass the userName parameter entered by the user, and then query the data table, you directly start to get the columns' values in the datatable, but you still don't know whether the data table contains data (whether the userName exists).
And This exception will be caught and a response will be returned directly.
Before getting the data, you can judge whether there are data rows in the data table, something like this:
if (dt.Rows.Count > 0)
{
//some code here
}
Second, after you have obtained the user information, have you checked the hashed value entered by the user? Is it the same as the data stored in the data table?
I think you should use the
debugger in Visual Studio to view the specific details of the code running.
If I misunderstood something, could you provided more details so that we can reproduce your problem and search for any solutions for this issue?
Best regards,
Xudong Peng