0

I have an Excel sheet and I want to fetch some data from excel to c# but the data I have is repeated in some columns.

I need select this data in combo-box but no-repeat

OleDbDataAdapter da = new OleDbDataAdapter("SELECT  TL From [Data$]", conn);
        DataTable dt = new DataTable();
        da.Fill(dt);
        comboBox2.DataSource = dt;
        comboBox2.DisplayMember = "TL";

Please help me with this code,

Thanks for all.

Govind Parmar
  • 20,656
  • 7
  • 53
  • 85

1 Answers1

0

Use 'DISTINCT' command in SQL query:

SELECT DISTINCT TL From [Data$]
Ivan Kishchenko
  • 795
  • 4
  • 15