Apr 18, 2017 01:16 AM|Deepak Panchal|LINK
I try to test your above mentioned code on my side.
I find that you made some mistakes in implement the code in your application.
(1) you had mentioned that you get this code example from MSDN site.
provide me the URL of that example.
(2) I can see that you are working with ASP.NET Web Form project.
but you are using void main() in your code behind.
Web Form project does not contain any Void Main().
this is your mistake here.
Console Application contains Void Main() in it to start the execution.
so I think that you add the Console application code in Web Form Application and that's why it is not working as expected.
please try to correct this issue and if you have any problem then let me know about that.
I will try to provide further suggestions to solve the issue.