I have a C# piece of code that uses dataview to sort a dropdownlist that gets populated from a web service. I would like to see how this piece of code can be use with ASP..net, I know it's impossible to convert a C# to ASP.net, but any suggestions and advice would be very much appreciated!
private void button1_Click(object sender, EventArgs e)
{
DataTable myDataTable = new DataTable();
myDataTable = ABC.NameNumberPhone(textBox1.Text.ToString()).Tables[0]; // ABC is the web reference
DataView myDataView = new DataView(myDataTable);
myDataView.Sort="Name";
comboBox1.DataSource = myDataView;
comboBox1.DisplayMember = "Name";
comboBox1.ValueMember = "Id";
}
private void button1_Click(object sender, EventArgs e)
{
DataTable myDataTable = new DataTable();
myDataTable = ABC.NameNumberPhone(textBox1.Text.ToString()).Tables[0]; // ABC is the web reference
DataView myDataView = new DataView(myDataTable);
myDataView.Sort="Name";
comboBox1.DataSource = myDataView;
comboBox1.DisplayMember = "Name";
comboBox1.ValueMember = "Id";
}