What does
---------------------------
---------------------------
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)
---------------------------
OK
---------------------------
that actually mean?
I take that to mean, "Things took too long so I just gave up."
I don't understand why there was a timeout though, because I set the timeout to 4 minutes and this error popped up in less than 30 seconds.
Why has this exact code been working the past week and now it just fails every single time???
I tried setting cmd.CommandTimeout = 240 which is a pretty long time to wait when debugging, and same problem. Nothing is getting updated in the database anymore. I don't understand what has changed.
try
{
// Insert into database
sqlconnection = new SqlConnection(@"Data Source=s1-removed-om;Initial Catalog=D-removed-t;Persist Security Info=True;User ID=D-removed-;Password=97-removed3-45;");
sqlconnection.Open();
cmd = new SqlCommand();
cmd.Connection = sqlconnection;
int count = 0;
foreach (var item in files)
{
cmd.CommandText = @"insert into Images (Name, Credits) values ('" + item.Value + "', '" + credits + "')";
cmd.ExecuteNonQuery();
count++;
}
doneUpdatingDB = true;
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
doneUpdatingDB = false;
}