Core to creating an OnBase Visual Studio application is to connecting to and querying the onbase database instance for various activities outside of what the API exposes. Here are the steps to do this:
OdbcConnection conn = openODBCConnection();
OdbcDataReader dr = null;
OdbcCommand cmd = null;
cmd = new OdbcCommand("select a.keyvaluechar from keyitem141 a " +
"where a.itemnum = '" + itemnumtemp + "'", conn);
dr = cmd.ExecuteReader();
while (dr.Read())
{
TempValue = dr[0].ToString().Trim();
}
conn.Close();
cmd.Dispose();
dr.Dispose();
... connection method
conn.ConnectionString = "DSN=OnBaseDSN;UID=hsi;PWD=password"
- Install the ODBC driver for your OnBase database
- Configure a Data Source Name entry
- Import the ODBC class for reference
- Write code to establish a connection object
- Open a connection
- Run through the results
- Close a connection
Here's some of the code to help do this:
... main code
OdbcConnection conn = openODBCConnection();
OdbcDataReader dr = null;
OdbcCommand cmd = null;
cmd = new OdbcCommand("select a.keyvaluechar from keyitem141 a " +
"where a.itemnum = '" + itemnumtemp + "'", conn);
dr = cmd.ExecuteReader();
while (dr.Read())
{
TempValue = dr[0].ToString().Trim();
}
conn.Close();
cmd.Dispose();
dr.Dispose();
... connection method
conn.ConnectionString = "DSN=OnBaseDSN;UID=hsi;PWD=password"