First, you need to install the PI-ODBC, configure the corresponding data source to connect to the PI database, you can find the installation directory PIPC \ ODBC folder ipisql.exe, this is similar to a small tool SQL query analyzer, double-click to open, the default PI database connection will be automatically connected. After the connection is successful, you can try to write a few SQL statements and view the result. (The SQL syntax of the PI database is slightly different from that of the SQL Server or Oracle database. You can view the help documentation at a Glance .)
Next, in The. Net project, you must reference Microsoft. Data. ODBC. DLL to access the ODBC data source. NextCodeWriting is no different from accessing a common ODBC data source. The difference is that you should pay attention to the writing of SQL statements. As mentioned above, you can refer to the relevant help documentation. Ipisql.exe can be used to check the validity and adequacy of SQL sentences. This tool is useful.
Although the access speed to Pi database through PI-ODBC is relatively slow, the actual application effect is still acceptable.