Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to bind list of string to combobox winform

$
0
0

my datatable has few ticker name those are string type. now see how i am fetching data

List<PocoTicker> _ticker = new List<PocoTicker>();
            string query = "SELECT [Ticker] FROM [dbo].[tbltest]";

            DataSet ds = SqlHelper.ExecuteDataset(conn,CommandType.Text, query);

            if (ds.Tables.Count > 0)
            {
                var table = ds.Tables[0];
                _ticker = table.AsEnumerable().Select(row => new  { Ticker = row.Field<string>("Ticker") }).ToList();
            }

see my code which is not compiling. i want to retrieve data from datatable using linq and store as list which i will bind later to combobox

tell me how to achieve this.

thanks


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>