Click here to Skip to main content
15,124,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
we are NOT using MVC in this project. Populating the IEnum like this;

C#
public IEnumerable<CompanyList> CompanyListe() {

        var connectionString = "foobar";


        using (SqlConnection connection = new SqlConnection(connectionString))
        {

            var command = "SELECT COMPANY_ID , COMPANY_ID FROM TUSER";

           return connection.Query<CompanyList>(command);

        }


            }

 public class CompanyList {

            public int COMPANY_ID { get; set; }

            public string COMPANY_NAME { get; set; }

        }

As a result, we have the data we request but don't know how to populate that without MVC, into a select list. Can you help?

What I have tried:

Nothing significant come up on my tries except the code I share.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900