annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Bulk Inserting Data using SqlBulkCopy class - Constructor on type System.Data.DataColumn not found

Risolto!
Vai alla soluzione

I am trying to use methods from the SQLBulkCopy class to do bulk inserts of data into a PostgreSQL RDBMS. Think "array of clusters." I'm basically buffering a bunch of data to be inserted when a task is completed, rather than constantly doing transactional inserts that have much more overhead.

 

To do this, I'm using the SqlBulkCopy(DataTable table) method as the IDataReader and DataRow objects don't have public constructors in LabVIEW. Here's my current implementation:

 

But that fails with this error:

 

 

The VI is attached for reference. Any ideas (or bulk insert alternatives) would be appreciated.

0 Kudos
Messaggio 1 di 6
4.815Visualizzazioni

Instead of using Typecast, use "To More Specific Class". Does that work better?

0 Kudos
Messaggio 2 di 6
4.794Visualizzazioni

Now I get "Type mismatch. Object cannot be cast to the specified type". I believe this is because the double constant isn't really a "datatype", which is what needs to be wired. I found an article detailing which .NET datatypes correspond to which LV datatypes, but I don't know how to make a datatype constant for .NET in LV. Ideas?

0 Kudos
Messaggio 3 di 6
4.791Visualizzazioni

Ok you don't need any changing clas or typecast - try using an Invoke Node with "GetType()" and wire that to the dataType input.

0 Kudos
Messaggio 4 di 6
4.788Visualizzazioni
Soluzione
Accettato da autore argomento ijustlovemath

SQL Insert System Type.png

Messaggio 5 di 6
4.786Visualizzazioni

Excellent! I got it to work using that:

 

 

It shows that I should probably get more familiar with the basic class methods and properties before going on any further eh? Thanks!

0 Kudos
Messaggio 6 di 6
4.783Visualizzazioni