How Can i Populate Bulk of Data from a DB Table into a Combo Box? - C#.NET
MenuItem menus = new MenuItem();
GridView1.DataSource开发者_如何学Python = menus.GetDataTable();
GridView1.DataBind();
menus.GetDataTable() returns a DataTable. In the above case, we are returning to GridView. I need to populate the data into a combo box. How can i do it?
NOTE: Assume GetDataTable only returns records of a single column.
I'm using Winforms
Check if this helps you.
Solution is:
Country countryName = new Country();
comCountryCus.DataSource = countryName.GetDataFromTable();
comCountryCus.DisplayMember = "CountryName";
http://msdn.microsoft.com/en-us/library/w67sdsex%28v=VS.80%29.aspx
K.I.S.S - Keep It Simple & Stupid.
精彩评论