public DataTable ConvertITable(ITable table)
                {

                        DataTable  ExpertInfo;
                        ExpertInfo = new DataTable("ExpertInfo");
                        
                        try
                        {
                                IQueryFilter que=new QueryFilterClass();
                                ICursor pCursor=table.Search(que,true);
                                IRow pRow = pCursor.NextRow();

                                if (pRow != null)
                                {
                                        for (int i = 0; i < pRow.Fields.FieldCount; i++)
                                        {
                                                ExpertInfo.Columns.Add(pRow.Fields.get_Field(i).Name);
                                        }
                                        while (pRow != null)
                                        {
                                                DataRow pDataRow = ExpertInfo.NewRow();
                                                for (int j = 0; j < pCursor.Fields.FieldCount; j++)
                                                        pDataRow[j] = pRow.get_Value(j);
                                                ExpertInfo.Rows.Add(pDataRow);
                                                pRow = pCursor.NextRow();
                                        }
                                }
                        }
                        catch (System.Exception ex)
                        {
                                MessageBox.Show(ex.Message);
                        }

                        return ExpertInfo;
                        
                

                } 

相关文章:

  • 2022-02-10
  • 2022-02-20
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-10
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
相关资源
相似解决方案