return string list

please review attachment.
bb.txt
solution1368Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

angus_young_acdcCommented:
And what is the problem?
0
Fernando SotoRetiredCommented:
And your question is ?.

Also you need to place strings in x, List<string>, otherwise you are returning an empty list.
0
solution1368Author Commented:
I just need to know how to get the List<string> and consume by c# codes.
Like the following comments will be the value from the database.
You are welcome to edit the codes I posted.

Thanks.
 
//geoCode1 = dt.Rows[xx]["geoCode1"].ToString();
//geoCode2 = dt.Rows[xx]["geoCode2"].ToString();
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

käµfm³d 👽Commented:
I suppose you are asking:

x.Add(dt.Rows[xx]["geoCode1"].ToString());
x.Add(dt.Rows[xx]["geoCode2"].ToString());

Open in new window


...but I agree with the others:  Your question is not clear.
0
solution1368Author Commented:
Thank.

x.Add make sense to me. in c# client like aspx/c#, how can I call it and populate the list into the e.g. dropdown box?

I will try my best to describe the question, and thank you for your helps.
0
käµfm³d 👽Commented:
Is this a Forms application or a web application?
0
solution1368Author Commented:
web
0
käµfm³d 👽Commented:
OK, then you should be able to do something like:

dropDownList1.DataSource = GetAgencyList("11111", "0.5");
dropDownList1.DataBind();

Open in new window

0
solution1368Author Commented:
sorry. it is web - mvc 3. not a web form.

Thanks.
0
käµfm³d 👽Commented:
Then you can use LINQ to create a new object to pass to a helper.

e.g.

Index.cshtml
@model List<string>

@{
    ViewBag.Title = "Index";
}

@Html.ListBox("listBox1", Model.Select(item => new SelectListItem() { Text = item, Value = item }))

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
solution1368Author Commented:
.? Not working
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.