我在 1 个数据库中有 2 个表
TABLE 1: LOGS
TABLE 2: MASTER LIST
LOGS
HOST | USER | NAME
==================
1 | A | A1
1 | A | B1
1 | A | C1
1 | A | D1
MASTER LIST
HOST | USER | NAME
===================
1 | A | A1
1 | A | B1
1 | A | C1
在我的 C# 程序中,我有一个 gridview,我需要突出显示未包含在主列表中的行
LOGS
HOST | USER | NAME
==================
1 | A | A1
1 | A | B1
1 | A | C1
**1 | A | D1**
这是我的 C# 代码:
//Create the OracleCommand
OracleCommand OCom = new OracleCommand("SERVERSTATUS.LOG_LIST", oc);
OCom.CommandType = CommandType.StoredProcedure;
OCom.Parameters.Add("out_RESULT", OracleType.Cursor).Direction = ParameterDirection.Output;
OCom.Parameters[0].Value = sid;
OracleDataAdapter _daGrid1 = new OracleDataAdapter(OCom);
_daGrid1.Fill(_dsGrid);
_daGrid1.Dispose();
_daGrid1 = null;
OCom.Dispose();
OCom = null;
if (frm_IT010_03 == null)
{
//button click show form with gridview
frm_IT010_03 = new IT010_03(_dsGrid);
frm_IT010_03.ShowDialog();
}
Class LogArray:这个类将数据从数据库存储到数组中。我怎样才能调用这个类?所以我可以将它与网格进行比较..
public void LogArray(ArrayList al)
{
OracleConnection oc = new OracleConnection(ConOra);
DataSet _dsGrid = new DataSet();
try
{
oc.Open();
}
catch (OracleException ex)
{
MessageBox.Show(ex.ToString());
}
try
{
OracleCommand OCom = new OracleCommand("SERVERSTATUS.LOG_STATUS", oc);
OCom.CommandType = CommandType.StoredProcedure;
OCom.Parameters.Add("out_RESULT", OracleType.Cursor).Direction = ParameterDirection.Output;
OracleDataReader DataReader = OCom.ExecuteReader();
while (DataReader.Read())
{
al.Add(DataReader.GetString(0));
}
}
catch
{
...
}
我在 Oracle 中编译了一个包含 2 个过程的包
Package name: Server Status
Procedure name: **Log_list** = Calls for the Logs Table
Procedure name: **Log_status** = Calls for the values that are in the logs table but is not included in the master list table.
谢谢!!=))