Beispiel #1
0
        public override void GetData()
        {
            ConditionForPackage();
            string query = string.Empty, queryMaster = string.Empty;

            this.GetQuery(ref queryMaster, ref query);
            DsData = DbData.GetDataSetDetail(queryMaster, query);

            string     fkName = _drTableMaster["Pk"].ToString();
            DataColumn pk     = DsData.Tables[1].Columns[fkName];
            DataColumn fk     = DsData.Tables[0].Columns[fkName];

            if (pk != null && fk != null)
            {
                DataRelation dr = new DataRelation(_drTable["TableName"].ToString(), pk, fk, true);
                DsData.Relations.Add(dr);
            }
            // DsData.Tables[0].PrimaryKey = new DataColumn[] { DsData.Tables[0].Columns[_drTable["pk"].ToString()] };
            if (DsData != null)
            {
                _dsDataTmp = DsData.Copy();
            }
        }