Example #1
0
 public void UpdateLookupValues()
 {
     if (LookupDataset.Length > 0)
     {
         Values.Clear();
         Items.Clear();
         DataInfo dinfo = Report.DataInfo[LookupDataset];
         dinfo.DisConnect();
         dinfo.Connect();
         try
         {
             int indexvalue = 0;
             if (dinfo.Data.Columns.Count > 1)
             {
                 indexvalue = 1;
             }
             while (!dinfo.Data.Eof)
             {
                 Items.Add(dinfo.Data.CurrentRow[0].ToString());
                 Values.Add(dinfo.Data.CurrentRow[indexvalue].ToString());
                 dinfo.Data.Next();
             }
         }
         finally
         {
             dinfo.DisConnect();
         }
     }
 }