DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Populating A Winforms ComboBox With Csharp

07.14.2006
| 10285 views |
  • submit to reddit
        
private void PoblarComboPais()
{
	// Trae las sociedades correspondientes al país
	Cursor.Current = Cursors.WaitCursor;
	// Conexión
	string cn = SqlOptions.ConnectionString();

	// DataReader
	this.cboPais.DataSource = SqlHelper.ExecuteDataset(cn,CommandType.Text , "SELECT * FROM MAE_PAIS").Tables[0];
	this.cboPais.ValueMember = "chrPais";
	this.cboPais.DisplayMember = "chrPaisNombre";

	//Puntero del mouse normal
	Cursor.Current = Cursors.Default;
}