Question: private async Task getDeviceDescription(int manufacture, string serialNumber) { var output = new sqlParameter(@deviceDescription, sqlDbType.NVarChar, 255) { Direction = ParameterDirection. Output }; await Database.ExecuteSqlCommandAsync(exec storedProcedure @manufacture,

private async Task getDeviceDescription(int manufacture, string serialNumber)

{

var output = new sqlParameter("@deviceDescription", sqlDbType.NVarChar, 255) { Direction = ParameterDirection. Output };

await Database.ExecuteSqlCommandAsync("exec storedProcedure @manufacture, @serialNumber, @deviceDescription OUT", new sqlParameter("@manufacture", manufacture), new sqlParameter("@serialNumber", serialNumber), output);

description = (string) output.Value;

return description;

}

I keep getting System.NotSupportedException: A second operation started on this context before a pervious asynchronous operation completed. Use await to ensure that any asynchronous operations have completed. I have a list of devices (100-1000 devices) and I want to get there description. I dont know how to get rid of this error and I noticed not all the descriptions are being shown like it skips some of the devices

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!