Technological recipes that I've held to prepare some solutions DBA environment. (by Felipe Donoso Bastias)

15 Nov 2007

.Net: LLenando un combobox en un formulario Windows

Script C# para llenar un combo box desde una base de datos Oracle:

private void button1_Click(object sender, EventArgs e)

{
OracleConnection oraConn = new OracleConnection();
oraConn.ConnectionString = "user id=hr;data source=antares;password=hr";
oraConn.Open();
OracleCommand oraCmd = new OracleCommand("SELECT REGION_NAME FROM regions", oraConn);
OracleDataReader oraReader = oraCmd.ExecuteReader();
while (oraReader.Read())
{
comboBox1.Items.Add(oraReader.GetValue(0).ToString());
}
oraReader.Close();
oraConn.Close();
}
}

Saludos.

Felipe Donoso B.

Share:

5 Comments:

Fernando said...

eres dios me has venido que ni pintado.Mil gracias

Anonymous said...

me guié para hacerlo con una tatla de sql server y funcionó ok, gracias 3 horas buscando la solucion y aqui estaba, gracias!!!

rc6016 said...

Que bueno "Anónimo" me alegro que te haya servido.

Saludos.
RC6016

thành nguyễn said...

tiếng anh giao tiếp cho trẻ em
chung cư newskyline
chung cư hateco hoàng mai
chung cư hà nội
dịch vụ hoàn thuế gtgt
dịch vụ kế toán thuế trọn gói

dịch vụ quyết toán thuế
khoá học kế toán thuế
trung tâm kế toán
dịch vụ báo cáo thuế
dịch vụ báo cáo tài chính tại tphcm

dich vu ke toan noi bo
dịch vụ dọn dẹp sổ sách trọn gói

xumeiqing said...

true religion
michael kors handbags
cheap jordan shoes
cheap nike air max
jordan shoes
lacoste shoes
wholesale nike shoes
michael kors canada
skechers outlet
coach outlet online
louis vuitton outlet online
chi flat iron
ray ban sunglasses sale
asics gel kayano
michael kors outlet canada
coach factory outlet
nike cortez white
discount nike air max
christian louboutin shoes
nike tn pas cher
ralph lauren pas cher
louis vuitton pas cher
sac longchamp
michael kors outlet store
coach outlet online
supra outlet
designer handbags wholesale
valentino bags
converse outlet
air max 90
versace sunglasses
christian louboutin outlet
michael kors outlet
nike huarache
fake oakleys
louis vuitton handbags
nike huarache black
ferragamo outlet
true religion jeans
rolex daytona
chenzhen20160511

Copyright © DBA TIPS | Powered by Blogger
Design by SimpleWpThemes | Blogger Theme by NewBloggerThemes.com | Free Blogger Templates