Click here to Skip to main content
15,904,503 members
Home / Discussions / C#
   

C#

 
AnswerRe: Gradient Texture with Transparency Pin
Manfred Rudolf Bihy28-Apr-11 12:30
professionalManfred Rudolf Bihy28-Apr-11 12:30 
GeneralRe: Gradient Texture with Transparency Pin
BoneSoft28-Apr-11 16:04
BoneSoft28-Apr-11 16:04 
QuestionHow to list network connections Pin
sarang_k28-Apr-11 0:31
sarang_k28-Apr-11 0:31 
AnswerRe: How to list network connections Pin
Blue_Boy28-Apr-11 3:25
Blue_Boy28-Apr-11 3:25 
GeneralRe: How to list network connections Pin
ambarishtv28-Apr-11 5:16
ambarishtv28-Apr-11 5:16 
AnswerRe: How to list network connections Pin
RaviRanjanKr29-Apr-11 9:03
professionalRaviRanjanKr29-Apr-11 9:03 
QuestionDataset selection question Pin
minnie mouse27-Apr-11 23:34
minnie mouse27-Apr-11 23:34 
AnswerRe: Dataset selection question Pin
Eddy Vluggen28-Apr-11 0:06
professionalEddy Vluggen28-Apr-11 0:06 
GeneralRe: Dataset selection question Pin
minnie mouse28-Apr-11 0:51
minnie mouse28-Apr-11 0:51 
AnswerRe: Dataset selection question Pin
wizardzz28-Apr-11 5:54
wizardzz28-Apr-11 5:54 
GeneralRe: Dataset selection question Pin
minnie mouse28-Apr-11 10:04
minnie mouse28-Apr-11 10:04 
QuestionHow to use c++ dll in c#.net Pin
sarang_k27-Apr-11 23:02
sarang_k27-Apr-11 23:02 
AnswerRe: How to use c++ dll in c#.net Pin
Pete O'Hanlon27-Apr-11 23:31
mvePete O'Hanlon27-Apr-11 23:31 
QuestionRename a file from his String Path [Resolved] Pin
Pierre besquent27-Apr-11 22:21
Pierre besquent27-Apr-11 22:21 
AnswerRe: Rename a file from his String Path Pin
Groulien27-Apr-11 22:37
Groulien27-Apr-11 22:37 
GeneralRe: Rename a file from his String Path Pin
Pierre besquent27-Apr-11 22:48
Pierre besquent27-Apr-11 22:48 
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 

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.