0

To put everyone in context: we have a deployed Windows Forms App, coded in C#, and querying data from/to a SQL Server 14 DB. Everything works fine, till the day we needed to push the app outside the main subnetwork 192.168.0.X, to 192.168.1.X.

Here with my partner, we believed that doing a little rework in the connection string could solve the first problem we had ahead (no connection to the DB; no login, no simple queries, no nothing), along this one, that doesn't allow us to write any data into the DB, using Stored Procedures or not. We already thinked that this could be one of the sources of this problem, but it wasn't, because we can do some SELECT queries without any drama. This, on the affected PC, of course.

Previously, it was:

user id=myUser; password=myPass; server=myIP; Trusted_Connection=no; database=myDBName; connection timeout=30;

Now, it is:

Data Source=myServerName; Initial Catalog=myDatabaseName; User ID=myUsername;Password=myPassword; Server=IP, Port (if necessary);

Simple Select Query

Some Screenshots of the Exceptions, printed in MessageBox'es:

1st (and 3rd) Exception: Possible Truncated Data (this repeats itself again after the 2nd one)

2nd Exception: Couldn't Open a Connection

We've already checked the TCP/IP, port configs from SSMS, physical firewall port forwarding, more variations on the conn. string, different IPv4 configs, and nothing seems to work (even with a new super user, with all DB and Server Privilegies). So here we are, so close, and so far from solving this thing.

2nd day Edit: Doing double checks in the affected code (where the Exceptions occur), even with the suggestions that @iakobski made, it's still the same. Same exceptions, in the same place. The only difference is the speed of the app to throw them, because it can close the pending transaction faster, and the exceptions are handled, thanks to the 'finally' clause.

Also, as I noticed while doing a deeper debugging, INSERT's or UPDATE's by themselves aren't the problem, but the Stored Procedures ones. Because it failed to Update/Select data in SP modules that uses the SQLSERVERPROCEDURE.SQLSERVER.Exec form, but not while inserting a Log Entry (which I believe is the classic way to execute SQL Commands):

        SqlCommand cmd = new SqlCommand();
        con.ConnectionString = CadenaConexion;
        cmd.Connection = con;
        cmd.CommandText = "INSERT INTO LOG(LOG_ID_USUARIO,LOG_FECHA,LOG_PROCESO,LOG_CANTIDAD,LOG_PEDIDO,LOG_ITEM)" +
                          "VALUES(@log_id_usuario, @log_fecha, @log_proceso, @log_cantidad, @log_pedido, @log_item)";

        try
        {
            cmd.Parameters.Add("@log_id_usuario", SqlDbType.Int).Value = Log_id_usuario;
            cmd.Parameters.Add("@log_fecha", SqlDbType.DateTime).Value = Log_fecha;
            cmd.Parameters.Add("@log_proceso", SqlDbType.Text).Value = Log_proceso;
            cmd.Parameters.Add("@log_cantidad", SqlDbType.Int).Value = Log_cantidad;
            cmd.Parameters.Add("@log_pedido", SqlDbType.Int).Value = Log_pedido;
            cmd.Parameters.Add("@log_item", SqlDbType.Int).Value = Log_item;

            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            return true;
        }
        catch (Exception ex)
        {
            exSrc = "log";
            exMsg = ex.Message;
            exNota = "ERR_LogUsu01: No se ha podido Insertar el Registro a la Tabla Log";
            exStTr = ex.StackTrace;
            registrarEnLogErr();
            MessageBox.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            return false;
        }
        finally { con.Close(); }

So, if yesterday I was pretty sure that this little file called SQLSERVERPROCEDURE.dll that has direct relations with the Stored Procedures that are processed by it has a lot to do here, I'm sure-r now. Somehow, it may be using the old Connection String, but I don't know how I can change it, because every call that's done to this file, refers to the Conn. String as "DBSQL" (tried to change it when calling, putting the SharedData.Instance().StringConexion, and also a 'cn' variable [with ToString()], with no luck. Said that the Conn. String is not defined). Take a look at the definition in a SP with .dll calling, and the .dll file itself:

Update Module:

        SqlConnection cn = new SqlConnection(SharedData.Instance().StringConexion);

        try
        {
            Dictionary<string, object> param = new Dictionary<string, object>();
            param.Add("@nta_venta", nta_venta);
            param.Add("@item", item);
            param.Add("@cantidad", cantidad);
            cn.Open();
            SQLSERVERPROCEDURE.SQLSERVER.Exec("DBSQL", SP, param);
            cn.Close();
        }
        catch (Exception ex)
        {
            exSrc = this.Name;
            exMsg = ex.Message;
            exNota = "ERR_Corte02: Pedido: " + nta_venta + "-" + item + " con Falta de Parámetros válidos en Actualiza";
            exStTr = ex.StackTrace;
            registrarEnLogErr();
            MessageBox.Show(ex.Message);
        }
        finally { cn.Close(); }

DLL File: Title on VS: SQLSERVER (from metadata)

#region Ensamblado SQLSERVERPROCEDURE, Version=1.0.0.0, Culture=neutral, 

PublicKeyToken=null
// C:\Users\User\source\repos\MY-APP\packages\EXECSQLSERVERPROCEDURE.2.0.0\lib\net40\SQLSERVERPROCEDURE.dll
#endregion

using System.Collections.Generic;
using System.Data;

namespace SQLSERVERPROCEDURE
{
    public static class SQLSERVER
    {
        public static DataTable Exec(string NombreConexion, string Procedimiento, Dictionary<string, object> VariableYValores, DataTable dt = null);
        public static DataSet Exec(string NombreConexion, string Procedimiento, Dictionary<string, object> VariableYValores, DataSet ds = null);
        public static void Exec(string NombreConexion, string Procedimiento, Dictionary<string, object> VariableYValores);
    }
}

1st StackTrace (not valid anymore because it's resolved with re-done Open and Close statements):

Excepción producida: 'System.Data.SqlClient.SqlException' en System.Data.dll
El subproceso 0x3f5c terminó con código 0 (0x0).
Excepción producida: 'System.Data.SqlClient.SqlException' en SQLSERVERPROCEDURE.dll
Excepción producida: 'System.InvalidOperationException' en System.Data.dll
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Transactions.resources\v4.0_4.0.0.0_es_b77a5c561934e089\System.Transactions.resources.dll' cargado. El módulo se compiló sin símbolos.
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Excepción no controlada</Description><AppDomain>myApp.exe</AppDomain><Exception><ExceptionType>System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>No está autorizado a cambiar la propiedad 'ConnectionString'. El estado actual de la conexión es abierta.</Message><StackTrace>   en System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
   en System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
   en MY_APP.Class.log_errores.INSERT_log_err() en C:\Users\User\Source\Repos\MY-APP\MY APP\Class\log_errores.cs:línea 34
   en MY_APP.PrcsCorte.registrarEnLogErr() en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 378
   en MY_APP.PrcsCorte.cargarPedido(Int32 nv, Int32 it) en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 267
   en MY_APP.PrcsCorte.PrcsCorte_Activated(Object sender, EventArgs e) en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 39
   en System.Windows.Forms.Form.OnActivated(EventArgs e)
   en System.Windows.Forms.Form.set_Active(Boolean value)
   en System.Windows.Forms.Form.WmActivate(Message&amp;amp; m)
   en System.Windows.Forms.Form.WndProc(Message&amp;amp; m)
   en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)</StackTrace><ExceptionString>System.InvalidOperationException: No está autorizado a cambiar la propiedad 'ConnectionString'. El estado actual de la conexión es abierta.
   en System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
   en System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
   en MY_APP.Class.log_errores.INSERT_log_err() en C:\Users\User\Source\Repos\MY-APP\MY APP\Class\log_errores.cs:línea 34
   en MY_APP.PrcsCorte.registrarEnLogErr() en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 378
   en MY_APP.PrcsCorte.cargarPedido(Int32 nv, Int32 it) en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 267
   en MY_APP.PrcsCorte.PrcsCorte_Activated(Object sender, EventArgs e) en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 39
   en System.Windows.Forms.Form.OnActivated(EventArgs e)
   en System.Windows.Forms.Form.set_Active(Boolean value)
   en System.Windows.Forms.Form.WmActivate(Message&amp;amp; m)
   en System.Windows.Forms.Form.WndProc(Message&amp;amp; m)
   en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)</ExceptionString></Exception></TraceRecord>
Excepción no controlada del tipo 'System.InvalidOperationException' en System.Data.dll
No está autorizado a cambiar la propiedad 'ConnectionString'. El estado actual de la conexión es abierta.

El subproceso 0x2e54 terminó con código 0 (0x0).
El subproceso 0x42cc terminó con código 0 (0x0).
El subproceso 0x3d84 terminó con código 0 (0x0).

Excepción no controlada: System.InvalidOperationException: No está autorizado a cambiar la propiedad 'ConnectionString'. El estado actual de la conexión es abierta.
   en System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
   en System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
   en MY_APP.Class.log_errores.INSERT_log_err() en C:\Users\User\Source\Repos\MY-APP\MY APP\Class\log_errores.cs:línea 34
   en MY_APP.PrcsCorte.registrarEnLogErr() en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 378
   en MY_APP.PrcsCorte.cargarPedido(Int32 nv, Int32 it) en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 267
   en MY_APP.PrcsCorte.PrcsCorte_Activated(Object sender, EventArgs e) en C:\Users\User\Source\Repos\MY-APP\MY APP\PrcsCorte.cs:línea 39
   en System.Windows.Forms.Form.OnActivated(EventArgs e)
   en System.Windows.Forms.Form.set_Active(Boolean value)
   en System.Windows.Forms.Form.WmActivate(Message& m)
   en System.Windows.Forms.Form.WndProc(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
El programa '[17180] myApp.exe' terminó con código 0 (0x0).

2nd StackTrace:

'myApp.exe' (CLR v4.0.30319: DefaultDomain): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: DefaultDomain): 'C:\Users\User\Source\Repos\MY-APP\MY APP\bin\Debug\myApp.exe' cargado. Símbolos cargados.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.resources\v4.0_4.0.0.0_es_b77a5c561934e089\System.Data.resources.dll' cargado. El módulo se compiló sin símbolos.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms.resources\v4.0_4.0.0.0_es_b77a5c561934e089\System.Windows.Forms.resources.dll' cargado. El módulo se compiló sin símbolos.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_es_b77a5c561934e089\mscorlib.resources.dll' cargado. El módulo se compiló sin símbolos.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\Users\User\Source\Repos\MY-APP\MY APP\bin\Debug\SQLSERVERPROCEDURE.dll' cargado. No se encuentra el archivo PDB o no se puede abrir.
'myApp.exe' (CLR v4.0.30319: myApp.exe): 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.dll' cargado. Se omitió la carga de símbolos. El módulo está optimizado y la opción del depurador 'Sólo mi código' está habilitada.
Excepción producida: 'System.Data.SqlClient.SqlException' en System.Data.dll
Excepción producida: 'System.Data.SqlClient.SqlException' en System.Data.dll
El subproceso 0x1184 terminó con código 0 (0x0).
El subproceso 0xfe0 terminó con código 0 (0x0).
El subproceso 0xc70 terminó con código 0 (0x0).
El subproceso 0x4b64 terminó con código 0 (0x0).
El subproceso 0x5e04 terminó con código 0 (0x0).
El subproceso 0x3ef4 terminó con código 0 (0x0).
El subproceso 0x3b58 terminó con código 0 (0x0).
El subproceso 0x480c terminó con código 0 (0x0).
Excepción producida: 'System.Data.SqlClient.SqlException' en SQLSERVERPROCEDURE.dll
El subproceso 0x48f0 terminó con código 0 (0x0).
El subproceso 0x4238 terminó con código 0 (0x0).
Excepción producida: 'System.Data.SqlClient.SqlException' en System.Data.dll
El subproceso 0x5ddc terminó con código 0 (0x0).
El subproceso 0x5184 terminó con código 0 (0x0).
El subproceso 0x3074 terminó con código 0 (0x0).
El subproceso 0x3bdc terminó con código 0 (0x0).
El subproceso 0x55f4 terminó con código 0 (0x0).
El subproceso 0x44b4 terminó con código 0 (0x0).
El programa '[18484] myApp.exe' terminó con código 0 (0x0).

SSMS Screenshots:

Server Roles

Database Roles

Permissions

Settings and Status

  • 1
    Hi and welcome to SO. When you encounter errors in programming you need to share the error message so others know what the problem is. – Sean Lange May 06 '19 at 20:49
  • 2
    If you can read but not write, the problem is with permissions in the database, not with the connection string. – Luis Cazares May 06 '19 at 20:50
  • @SeanLange there's not much to see on this part, because when we only query with a SELECT statement, all's fine, but whenever we use a INSERT or UPDATE or DELETE statement, with or without Stored Procedures, it fails, and it double fails because one is when we try to Update an Item Process (1st try catch), and then, it fails again when it tries to record the error in the Error Log (2nd try catch); both when they try to open the conn – Wolney Sandoval May 06 '19 at 20:54
  • As @LuisCazares said, it could be a permissions problem, but how can it be, than a new user with all privilegies (almost like 'sa'), fails? :( – Wolney Sandoval May 06 '19 at 20:55
  • 1
    It fails....there is an error message. What is the error message? That is what you need to debug this. It is almost certainly a permissions issue. Knowing what the error message says would clear it up. – Sean Lange May 06 '19 at 21:00
  • 1
    Don't try to write to an error log, you need to get the error message where you can see it. This is a very common design problem. You can't assume you can always write to the database. You should have a try/catch inside your catch to let the exception continue unhandled if your error handling logic has an error. – Sean Lange May 06 '19 at 21:02
  • If you want to prevent writing to the database create a credential the only allows reads to the database. SQL Server has two different types of credentials. 1) Windows credentials Integrated Security = True which uses the default user and then looks up password in the Windows user login 2) SQL Server credentials using an account in the SQL Server which is Integrated Security = False. I always recommend using the Window Credentials which is more secure. – jdweng May 06 '19 at 21:51
  • @SeanLange there's the debug log, with the 2 exceptions mentioned before. And so are the permissions screenshots. Hope that can lead to a solution :) – Wolney Sandoval May 06 '19 at 22:43
  • @jdweng if I use Windows Credentials, that wouldn't be an issue when trying to login in a remote machine? – Wolney Sandoval May 06 '19 at 22:45
  • Widows doesn't allow a remote connection without the connection being trusted which would requires a Windows Credential. So to get access to the SQL Server you first have to get through the windows firewall. So using a SQL Server User Name and Password will never work. – jdweng May 06 '19 at 23:38
  • @jdweng yeah, I get the point, but it doesn't seem to be the solution to this problem... Gotta keep trying with something else. I'm pretty sure that I'm leaving something behind. Thanks for your comments, buddy – Wolney Sandoval May 07 '19 at 04:10
  • The error message can't be more clear. – Sean Lange May 07 '19 at 13:46

2 Answers2

1

The problem is shown in your error message, you cannot change the connection string on an existing connection. You should always open a new connection every time you want to access the database and dispose it as soon as you are done, by enclosing it in a using block:

using(SqlConnection connection = new SqlConnection(<connection string>))
{
    connection.Open();
    // database interaction here
}

The connection will be disposed on leaving the using block. Do not worry that you are creating a lot of connections and think it will hit performance, the connection pool will handle that for you.

iakobski
  • 1,000
  • 7
  • 8
  • I did this, and solved the unhandled exception problems, but I still have to deal with the read only operations – Wolney Sandoval May 07 '19 at 18:32
  • I don't understand your code - how are you using the connection, you don't pass it into the function that calls the stored procedure. Also, if you use a using block as described above, you don't need to have a finally block or close the connection explicitly. – iakobski May 07 '19 at 20:13
  • Also, the message "data would be truncated" means that you have not matched the C# parameters with the SQL parameters, I think we need to see the code for `SQLSERVER.Exec()` – iakobski May 07 '19 at 20:16
  • the code is up there, buddy. You can check it if you like. Also, I believe that message refers that DB string lenght is not long enough to save them when the Error Log method tries to save it – Wolney Sandoval May 08 '19 at 14:05
  • I can see the method signature but not the body. Your problem is clearly there. You are not passing the connection to the Exec function, and cn is local so it can't be using it! If you don't know what's going on inside the dll you're using, why not ditch it and use the standard functions? – iakobski May 08 '19 at 17:50
0

First, sorry about posting this so late. Second, among all the answers, I can say I did the following (and worked):

  • Added using blocks to all DB performing operations
  • Added a IsServerConnected Method, using this as reference: What's the best way to test SQL Server connection programmatically? in my Error Log Method
  • (This is the real answer) Went to App.config file and checked the special Connection String that EXECSQLSERVERPROCEDURE plugin uses, and updated the DB Connection Credentials

Sometimes, the most headbreaking problems have incredible easy answers, don't you think?

Thanks guys!