Online Help - Region 4: [CORE HL7 MSSQL] |
Description: Provides Microsoft SQL Server Connectivity (Native Connection). See the SQL Connector Demo.
IMPORTANT NOTE: Whatever SQL Server credentials you use in your COREHL7MSSQLConnector object they MUST have full rights to the database. You don't have to use SA but the credentials MUST have full rights otherwise.
public COREHL7MSSQLConnector()
public COREHL7MSSQLConnector(string servername, string databasename, int connectionTimeout = 40)
public COREHL7MSSQLConnector(string servername, string databasename, string sqlUserID, string sqlPassword, int connectionTimeout = 40)
|
Example 1: private COREHL7MSSQLConnector GetConnector1() { //Basic Construction COREHL7MSSQLConnector conn = new COREHL7MSSQLConnector(); conn.ServerName = "localhost"; conn.DatabaseName = "HL7Testing"; //Use the Trusted Connection conn.UseSQLSecurity = false; //30 Second Timeout conn.ConnectionTimeOut = 30; conn.ForceTLSEncryption= false; return conn; } Example 2: private COREHL7MSSQLConnector GetConnector2() { //Create with some parameters COREHL7MSSQLConnector conn; conn = new COREHL7MSSQLConnector("localhost","HL7Testing"); //conn.ConnectionTimeOut - Will be 40 seconds; conn = new COREHL7MSSQLConnector("localhost", "HL7Testing", 30); //conn.ConnectionTimeOut - Will be 30 seconds; //conn.UseSQLSecurity - Will be FALSE //conn.ForceTLSEncryption - Will be false; return conn; } Example 3: private COREHL7MSSQLConnector GetConnector3() { //Create with all parameters COREHL7MSSQLConnector conn; conn = new COREHL7MSSQLConnector("localhost", "HL7Testing", "sa", "password", 60); //conn.ConnectionTimeOut - Will be 60 seconds; //conn.UseSQLSecurity - Will be TRUE //conn.ForceTLSEncryption - Will be false; //Set to true if you want conn.ForceTLSEncryption = true; return conn; }
|
|
|
|
The CORESQLQueryItem Object is a simple class used to pass SQL Statements and Queries to the COREMSSQLConnector object methods. It has only 2 properties which are required and passed in the constructor. They are: public string SQLString; public string TableName;
Create the object like so: CORESQLQueryItem qi = new CORESQLQueryItem("select * from patients","PatientTable");
Referenced In Connector Methods:
•OpenSQLQuery() •OpenSQLQueries() •OpenSQLDataTable()
|