I'm trying to make some c#. I have a sqldatareader to get the logical
file names from *.BAK files. It works on the default instance but if I
add a named instance it fails. It gives me this:
System.Data.SqlClient.SqlException: A transport-level error has
occurred when sending the request to the server. (provider: TCP
Provider, error: 0 - An existing connection was forcibly closed by the
remote host.)
I don't get this error on the default instance. Any ideas what is
going on?
Here is my sqldatareader code part:
SqlConnection conn = new SqlConnection(getConnStr(instance));
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader ln = cmd.ExecuteReader();
string logname = string.Empty;
while (ln.Read())
{
logname += ln[0].ToString() + ",";
}
ln.Close();
Any ideas what is happening?