NexusDB Newsgroups

NexusDB Newsgroups (http://www.nexusdb.com/forums/index.php)
-   nexusdb.public.support.adoprovider (http://www.nexusdb.com/forums/forumdisplay.php?f=10)
-   -   NexusDB.AdoProvider V4.0.30319 and DLL (http://www.nexusdb.com/forums/showthread.php?t=20591)

denisprince 23rd November 2018 01:39 PM

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

denisprince 24th November 2018 02:08 AM

NexusDB.AdoProvider V4.0.30319 and DLL
 
It's all ok now.

It was only on the first call and while debugging the dll with a startup project from VS. When outside the debugger, everything is working fine.

Denis Prince


All times are GMT +11. The time now is 06:15 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.