private OleDbDataReader rd;
private OleDbConnection Conn;
private string strRet;
private OleDbCommand cmd;
private StringBuilder sbSQL;
private OleDbParameter paramnSeq;
try
{
// SQLOLEDB MSDAORA
Conn = new OleDbConnection("Provider=MSDAORA;Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.xxx )(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = GROUP))); User Id =; Password =;");
Conn.Open();
try
{
sbSQL = new StringBuilder();
sbSQL.Append(" SELECT * ");
sbSQL.Append(" FROM HEIS_CUSTOMER ");
sbSQL.Append(" WHERE 1=1 ");
sbSQL.Append(" AND CUSTOMER_CODE = ? ");
paramnSeq = new OleDbParameter("CUSTOMER_CODE", OleDbType.Char, 4);
paramnSeq.Value = "0003";
cmd = new OleDbCommand(sbSQL.ToString(), Conn);
cmd.Parameters.Add(paramnSeq);
rd = cmd.ExecuteReader();
if (rd.Read())
{
strRet = rd["CUSTOMER_CODE"].ToString();
}
else
{
strRet = "";
}
}
catch (System.Exception e1)
{
throw e1;
}
finally
{
rd.Close();
}
}
catch (System.Exception e2)
{
throw e2;
}
finally
{
Conn.Close();
}