/// 获得指定存储过程的参数描述
/// </summary>
/// <param name="strProcname"></param>
/// <returns></returns>
private DataTable GetProcParam(string strProcname)
{
string strCmd = string.Format("select a.PARMNAME,a.TYPENAME,a.LENGTH,a.PARM_MODE,a.ORDINAL from SYSCAT.PROCPARMS a where procname='{0}' ORDER BY A.ORDINAL", strProcname);
DB2Command myCom = new DB2Command(strCmd, new DB2Connection(pModule.ConnectionString));
DB2DataAdapter da = new DB2DataAdapter();
da.SelectCommand = myCom;
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
/// <summary>
/// 获得指定表的存储过程列表
/// </summary>
private void GetProcArrayByTableName(string strTbName)
{
string strCmd = string.Format("select PROCNAME,REMARKS from SYSCAT.PROCEDURES where SPECIFICNAME in(select dname from sysibm.sysdependencies where bname in ( select PKGNAME from syscat.packagedep where bname='{0}'))", strTbName);
DataTable dt = new DataTable();
DB2Command myCom = new DB2Command( strCmd,new DB2Connection(pModule.ConnectionString));
DB2DataAdapter da = new DB2DataAdapter();
da.SelectCommand = myCom;
da.Fill(dt);
listBoxControl1.SelectedIndex = -1;
listBoxControl1.DataSource = dt.DefaultView;
}
private void GetProcArrayByProcName(string strProcname)
{
string strCmd = string.Format("select PROCNAME,REMARKS from SYSCAT.PROCEDURES where PROCNAME like '%{0}%'", strProcname);
DataTable dt = new DataTable();
DB2Command myCom = new DB2Command(strCmd, new DB2Connection(pModule.ConnectionString));
DB2DataAdapter da = new DB2DataAdapter();
da.SelectCommand = myCom;
da.Fill(dt);
listBoxControl1.SelectedIndex = -1;
listBoxControl1.DataSource = dt.DefaultView;
}
/// <summary>
/// 获取数据库所有表
/// </summary>
private void LoadData()
{
string strCmd="select TABNAME from syscat.TABLES where tabschema='WZGLZHAO'";
DataTable dt = new DataTable();
DB2Command myCom = new DB2Command(strCmd, new DB2Connection(pModule.ConnectionString));
DB2DataAdapter da = new DB2DataAdapter();
da.SelectCommand = myCom;
da.Fill(dt);
listBoxControl1.DisplayMember = "TABNAME";
listBoxControl1.ValueMember = "TABNAME";
listBoxControl1.DataSource = dt.DefaultView;
}