I am trying to make a SQL call from the IOM API and I am having issues connecting to the DB.
Using sqlcmd As SqlClient.SqlCommand = Import.SqlConnection.CreateCommand()
sqlcmd.CommandText = String.Format(sqlbase, Import.Fields.GetByIndex(0).Value)
fromConsID = CInt(sqlcmd.ExecuteScalar())
sqlcmd.CommandText = String.Format(sqlbase, Import.Fields.GetByIndex(1).Value)
toConsID = CInt(sqlcmd.ExecuteScalar())
Source row 1 produced Excel error row 2: Error in custom code AfterDictionaries: ExecuteScalar requires an open and available Connection. The connection's current state is closed. Line:0 [CImport_Process_02.6]
what am I missing here?