Find the value in gridview using findcontrol and comapre it with data in database

protected void LinkButton_Click(Object sender, EventArgs e) { String MyConnection2 = "Server=localhost;database=ovs;Uid=root;password=; Convert Zero Datetime=True"; DateTime time = DateTime.Now; // Use current time string format = "yyyy-MM-dd HH:mm:ss"; string UserName4 = HttpContext.Current.User.Identity.Name; GridViewRow grdrow = (GridViewRow)((LinkButton)sender).NamingContainer; Label lblStudentId = (Label)grdrow.Cells[0].FindControl("lblID"); string studentId = lblStudentId.Text; String query = "insert into voting (CandidateStudentID,voterStudentID,DateTime)values ('" + lblStudentId.Text + "','" … Read more

C# service cannot connect to web service after server upgrade

I am using HttpClient.PostAsync to call a REST web service (Unified Endpoint Management, but I doubt that is relevant) on a remote (internal LAN) server. The call is throwing an exception as follows: 10/15/2020 5:05:25 AM An error occurred while sending the request. 10/15/2020 5:05:25 AM at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 10/15/2020 5:05:25 … Read more