View Single Post
  #1  
Old 23rd November 2018, 01:39 PM
denisprince denisprince is offline
Junior Member
 
Join Date: Aug 2011
Posts: 12
Default NexusDB.AdoProvider V4.0.30319 and DLL

Hi,

I need to connect to NexusDB from inside a DLL written in C#.

Here is the code I've been using in a WindowsFormApplication for a while:

WindowFormApplication:
....
....
using NexusDB.ADOProvider;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
NxConnection connection = default(NxConnection);
NxDataAdapter adapter = new NxDataAdapter();
string sql = null;

connection = new nxConnection("Server=127.0.0.1;Database=DpFmpNxDat a;Port=16000;Native=True;Embedded=False;Username=; Password=;Timeout=10000;BlockReadSize=0;NativeTran sportType=TCP/IPV4;SecureTransportKey=");
sql = "INSERT INTO WSRAMQ_LOG(USER,SERVICE,IDMACHINE,IDUTIL,LOG,Succe ss,Agence) values(6,0,'ARG16100H','','Test',true,'16100')";
connection.Open();
adapter.InsertCommand = new NxCommand(sql, connection);
adapter.InsertCommand.ExecuteNonQuery();
}
}
}

If I use this same code with the same NexusDB.ADOProvider in a class library ( DLL , UnManagedExports), I get an exception on the line:
connection.Open(); <<===

$2C0E/11278 Cannot locate or connect to network server.

Any clues?

Thank you,

Denis Prince