Anyone here fluent in C#?

Fireworks

User is banned.
Reputation
0
I'm writing a pretty big application and I need some help. If you're fluent in C# or know how to add a list to a listbox control from a SQL query then let me know.

Here's a sample of the code I have.

PHP:
public List<Person> getNameAd(string username)
        {
            var AdNameList = new List<Person>();
            this.OpenConnection();
            string query = " * snip* "
            MySqlCommand cmd = new MySqlCommand(query, connection);
            using (var reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    var person = new Person();
                    person.Ad_Name = reader["Ad_Name"].ToString();

                    AdNameList.Add(person);
                }
            }

            return AdNameList;

        }
 
Your best bet is to have a PHP back end to grab the query info and return it back, then just add the lbi.

Lemme know if you need any help, I can pist an example in AM
 
Agree with Fusion on the backend. Return results in JSON and deserialize with Newtonsoft's JSON to populate the LB.
 
This is a pretty old post. I don't even have the source to this anymore.
 
Fireworks said:
This is a pretty old post. I don't even have the source to this anymore.

Completely missed the thread date and only saw the last guy's reply. Sorry for the gravedig.
 
Please don't use PHP syntax highlighting ever again with C#. k thx
 
Back
Top