LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL connection

Hello all,

 

i have installed , SQL server and SQL studio manager, now i want to initiate connection between my SQL database and Labview. 

i have read articles where, this can be done using Toolkit, but i dont have toolkit . is there any alternative way to establish connection?

 

Thank you,

Sibangi

0 Kudos
Message 1 of 9
(3,993 Views)

When I need to connect to a DB I prefer to use a connection string.

It is a textual way to connect to your DB, try to look here (https://www.connectionstrings.com/)

 

The second and simple way is to create a user or system DSN (by odbc windows) and call it by name.

 

To do this you need the LabVIEW Database Connectivity Toolkit

Message 2 of 9
(3,962 Views)

@ico82 wrote:

To do this you need the LabVIEW Database Connectivity Toolkit


There are alternatives, like LabSQL (free, but do read the license).

Message 3 of 9
(3,937 Views)

Hi.  I know this is an old post but wanted to share this code, which connects to a database and queries it using .NET calls.  No toolkit required, but it will only work on windows.  Hope this helps someone.   The sample code doesn't dispose and close references or do any error checking like it should. 

0 Kudos
Message 4 of 9
(3,073 Views)

@Joltosa wrote:

Hi.  I know this is an old post but wanted to share this code, which connects to a database and queries it using .NET calls.  No toolkit required, but it will only work on windows.  Hope this helps someone.   The sample code doesn't dispose and close references or do any error checking like it should. 


So why not use a toolkit that does the same thing, but does close, dispose and error check things properly?

0 Kudos
Message 5 of 9
(3,052 Views)

Isn't the Labview Database toolkit a standard toolkit? It might not be but its pretty easy....

 

image.png

0 Kudos
Message 6 of 9
(3,040 Views)

It's not standard (as in standard included).

 

It seems to be free nowadays: LabVIEW Database Connectivity Toolkit Download - NI

 

But it's probably still password protected, so it comes as is.

 

My first (and last) attempt with it was years ago. It didn't understand variations of the string type, so it required me to change the database to humor it. I switched to LabSQL, that needed tweaking, but at least that was possible.

0 Kudos
Message 7 of 9
(3,030 Views)

Joltosa_0-1610385298716.png

One advantage of using the .NET calls is you can then also use SqlBulkCopy.  I don't think that capability is available via the toolkit.  With the toolkit you would have to instead use BULK INSERT which requires the data to first be written to a file at a network location that is both writable by your users and visible to the database.

0 Kudos
Message 8 of 9
(3,015 Views)

Not the toolkit, a toolkit 😊.

 

I'm not even sure if there is a .NET based database toolkit, besides the one I'm using internally (ignoring my own advice 😎). But if there is one, and it's open, it's probably much easier to add bulk copy then to make everything else again (resulting in a toolkit).

 

I'll have to look into that bulk copy. It might be a good addition although I never needed it so far. 

0 Kudos
Message 9 of 9
(2,992 Views)