Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
GeneralRe: Rename a file from his String Path Pin
ambarishtv28-Apr-11 5:32
ambarishtv28-Apr-11 5:32 
GeneralRe: Rename a file from his String Path Pin
Pete O'Hanlon28-Apr-11 8:04
mvePete O'Hanlon28-Apr-11 8:04 
QuestionRDLC print icon not displayed in Mozilla Firefox Pin
yesu prakash27-Apr-11 20:35
yesu prakash27-Apr-11 20:35 
AnswerRe: RDLC print icon not displayed in Mozilla Firefox Pin
Pete O'Hanlon27-Apr-11 20:44
mvePete O'Hanlon27-Apr-11 20:44 
GeneralRe: RDLC print icon not displayed in Mozilla Firefox Pin
yesu prakash27-Apr-11 22:45
yesu prakash27-Apr-11 22:45 
AnswerRe: RDLC print icon not displayed in Mozilla Firefox Pin
thatraja27-Apr-11 22:50
professionalthatraja27-Apr-11 22:50 
AnswerRe: RDLC print icon not displayed in Mozilla Firefox Pin
RaviRanjanKr29-Apr-11 10:08
professionalRaviRanjanKr29-Apr-11 10:08 
Questionhow to fill a combobox with a class Pin
adrian salas27-Apr-11 11:11
adrian salas27-Apr-11 11:11 
Hi,

I am filling a combobox with the code below:

private void frmCrearCooperativa_Load(object sender, EventArgs e)
{
string nacionalidad = "select * from cs_nacionalidad";
try
{
//open connection
bdConex.OpenConnection();
//create command and assign the query and connection from the constructor
MySqlDataAdapter da = new MySqlDataAdapter(nacionalidad, bdConex.conn);
//create dataset
DataSet ds = new DataSet();
// filling dataset
da.Fill(ds, "cs_nacionalidad");
//dataset values
cboNacionalidad.DataSource = ds.Tables["cs_nacionalidad"];
cboNacionalidad.DisplayMember = "nm_nacionalidad";
cboNacionalidad.ValueMember = "cd_nacionalidad";
//close connection
bdConex.CloseConnection();
}

catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

how do I can do a class that fills the combobox with this code?
because I have to write it down in all forms.

thanks.
AnswerRe: how to fill a combobox with a class Pin
gavindon27-Apr-11 11:17
gavindon27-Apr-11 11:17 
AnswerRe: how to fill a combobox with a class Pin
sanforjackass27-Apr-11 11:20
sanforjackass27-Apr-11 11:20 
AnswerRe: how to fill a combobox with a class Pin
walterhevedeich27-Apr-11 14:51
professionalwalterhevedeich27-Apr-11 14:51 
AnswerRe: how to fill a combobox with a class [EDITED] Pin
Łukasz Nowakowski27-Apr-11 21:24
Łukasz Nowakowski27-Apr-11 21:24 
GeneralRe: how to fill a combobox with a class [EDITED] Pin
adrian salas28-Apr-11 6:11
adrian salas28-Apr-11 6:11 
GeneralRe: how to fill a combobox with a class [EDITED] Pin
Łukasz Nowakowski28-Apr-11 10:17
Łukasz Nowakowski28-Apr-11 10:17 
GeneralRe: how to fill a combobox with a class [EDITED] Pin
adrian salas29-Apr-11 10:29
adrian salas29-Apr-11 10:29 
GeneralRe: how to fill a combobox with a class [EDITED] Pin
Łukasz Nowakowski1-May-11 7:24
Łukasz Nowakowski1-May-11 7:24 
GeneralRe: how to fill a combobox with a class [EDITED] Pin
adrian salas2-May-11 13:44
adrian salas2-May-11 13:44 
AnswerRe: how to fill a combobox with a class Pin
minnie mouse28-Apr-11 1:02
minnie mouse28-Apr-11 1:02 
QuestionProcess Pin
viliam27-Apr-11 10:19
viliam27-Apr-11 10:19 
QuestionInput validation [modified] Pin
jashimu27-Apr-11 9:06
jashimu27-Apr-11 9:06 
AnswerRe: Input validation Pin
Pete O'Hanlon27-Apr-11 9:25
mvePete O'Hanlon27-Apr-11 9:25 
GeneralRe: Input validation Pin
jashimu27-Apr-11 9:39
jashimu27-Apr-11 9:39 
GeneralRe: Input validation Pin
Pete O'Hanlon27-Apr-11 10:02
mvePete O'Hanlon27-Apr-11 10:02 
AnswerRe: Input validation Pin
walterhevedeich27-Apr-11 14:54
professionalwalterhevedeich27-Apr-11 14:54 
GeneralRe: Input validation Pin
Pete O'Hanlon27-Apr-11 15:11
mvePete O'Hanlon27-Apr-11 15:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.