01-29-2020 12:39 AM
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
01-29-2020 02:29 AM
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
01-29-2020 03:51 AM
01-09-2021 11:00 AM
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.
01-11-2021 02:59 AM
@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?
01-11-2021 07:21 AM
Isn't the Labview Database toolkit a standard toolkit? It might not be but its pretty easy....
01-11-2021 07:59 AM
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.
01-11-2021 11:56 AM
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.
01-12-2021 02:46 AM
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.