error occurred while enabling mars for this connection
-
Hi, I have an asp.net application and using connection string to connect to database. But I am getting below error. Connection open and login was successful, but then an error occurred while enabling MARS for this connection. (provider: Name Pipes Provider, error:15- Function not supported) I am using Asp.net framework 4.5 and SQl server 2012 DataTable dt = new DataTable(); SqlConnection objcon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["test"].ToString()); using (var command = new SqlCommand("SELECT * FROM testData", objcon)) { var formCollection = new List<Form>(); try { objcon.Open(); command.CommandTimeout = 3000; var res = command.ExecuteReader(); objcon.Close(); lblID.Text ="Success"; } catch (Exception ex) { objcon.Close(); lblID.Text = ex.Message; } }
-
Hi, I have an asp.net application and using connection string to connect to database. But I am getting below error. Connection open and login was successful, but then an error occurred while enabling MARS for this connection. (provider: Name Pipes Provider, error:15- Function not supported) I am using Asp.net framework 4.5 and SQl server 2012 DataTable dt = new DataTable(); SqlConnection objcon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["test"].ToString()); using (var command = new SqlCommand("SELECT * FROM testData", objcon)) { var formCollection = new List<Form>(); try { objcon.Open(); command.CommandTimeout = 3000; var res = command.ExecuteReader(); objcon.Close(); lblID.Text ="Success"; } catch (Exception ex) { objcon.Close(); lblID.Text = ex.Message; } }
I'd guess you're enabling MARS in your connection-string, and the server somehow refuses to enable it. If you are not using an Express-edition, I'd recommend checking if the feature is installed and turned on.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)