• Welcome to ForumKorner!
    Join today and become a part of the community.

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;

        }
 

sdk

User is banned.
Reputation
0
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
 

Odus

User is banned.
Reputation
0
Agree with Fusion on the backend. Return results in JSON and deserialize with Newtonsoft's JSON to populate the LB.
 

Fireworks

User is banned.
Reputation
0
This is a pretty old post. I don't even have the source to this anymore.
 

Odus

User is banned.
Reputation
0
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.
 

1UP

Power member.
Reputation
0
Please don't use PHP syntax highlighting ever again with C#. k thx
 
Top