Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
GeneralRe: Nullable reference types in C# Pin
jschell20-Nov-17 6:36
jschell20-Nov-17 6:36 
GeneralRe: Nullable reference types in C# Pin
Eddy Vluggen20-Nov-17 6:37
professionalEddy Vluggen20-Nov-17 6:37 
QuestionC# and SQL application help Pin
Member 1352717817-Nov-17 6:35
Member 1352717817-Nov-17 6:35 
GeneralRe: C# and SQL application help Pin
Sascha Lefèvre17-Nov-17 7:07
professionalSascha Lefèvre17-Nov-17 7:07 
AnswerRe: C# and SQL application help Pin
OriginalGriff17-Nov-17 8:07
mveOriginalGriff17-Nov-17 8:07 
QuestionRe: C# and SQL application help Pin
Member 1352717817-Nov-17 11:13
Member 1352717817-Nov-17 11:13 
AnswerRe: C# and SQL application help Pin
OriginalGriff17-Nov-17 23:13
mveOriginalGriff17-Nov-17 23:13 
QuestionHow to put two columns in a combo box Pin
Member 1227854217-Nov-17 0:20
Member 1227854217-Nov-17 0:20 
Please help. How to put two columns in a combo box (list Box, text box:mad. I work with VS2015, c# and MySql 5.7.
Attached part of the code.

private void comboBox1_Click (object sender, EventArgs e)
{
MySqlConnection conn;
myConnectionString = pwput;
conn = new MySql.Data.MySqlClient.MySqlConnection ();
conn.ConnectionString = myConnectionString;
try
{
conn.Open ();
}
catch (MySqlException ex)
{
switch (ex.Number)
{
case 0:
MessageBox.Show ("DO NOT SUCCE TO CONNECT ON SERVER, CLOSE PROGRAM TO TAKE A REPLY");
Close ();
break;
case 1042:
MessageBox.Show ("NOT ACTIVE SERVER, SUBSCRIBE SERVER PA REPEAT CONNECTING");
Close ();
break;
}
conn.Close ();
}
if (conn.State! = ConnectionState.Open)
{
MessageBox.Show ("DO NOT SUCCE TO CONNECT ON SERVER \ r \ n CLOSE PROGRAM TO TAKE READY \ r \ n");
}
else
{
AutoCompleteStringCollection kontoopis = new AutoCompleteStringCollection ();
string wnadidok = "SELECT idkonto, FROM account name";
loadingData = false;
DataTable dtkon = new DataTable ();
dtkon.Columns.Add ();
dtkon.Columns.Add ();
MySqlDataAdapter mdkon = new MySqlDataAdapter (wnadidok, conn);
mdkon.Fill (dtkon);
loadingData = true;
comboBox1.DataSource = dtkon;
// which field is shown in the table below
comboBox1.DisplayMember = "idkonto";
comboBox1.ValueMember = "idkonto";
comboBox1.DisplayMember = "title";
comboBox1.ValueMember = "title";
comboBox1.SelectedIndex = -1;
comboBox1.Text = "";
loadingData = false;
}
conn.Close ();
}

Thank you
AnswerRe: How to put two columns in a combo box Pin
Eddy Vluggen17-Nov-17 0:46
professionalEddy Vluggen17-Nov-17 0:46 
GeneralRe: How to put two columns in a combo box Pin
Member 1227854220-Feb-18 1:17
Member 1227854220-Feb-18 1:17 
AnswerRe: How to put two columns in a combo box Pin
Karthik_Mahalingam17-Nov-17 0:59
professionalKarthik_Mahalingam17-Nov-17 0:59 
GeneralRe: How to put two columns in a combo box Pin
Member 1227854220-Feb-18 1:09
Member 1227854220-Feb-18 1:09 
GeneralRe: How to put two columns in a combo box Pin
Karthik_Mahalingam20-Feb-18 1:11
professionalKarthik_Mahalingam20-Feb-18 1:11 
QuestionActive Directory Questions Pin
Kevin Marois16-Nov-17 7:58
professionalKevin Marois16-Nov-17 7:58 
AnswerRe: Active Directory Questions Pin
Richard Deeming16-Nov-17 9:50
mveRichard Deeming16-Nov-17 9:50 
GeneralRe: Active Directory Questions Pin
Kevin Marois16-Nov-17 10:01
professionalKevin Marois16-Nov-17 10:01 
GeneralRe: Active Directory Questions Pin
Kevin Marois16-Nov-17 10:49
professionalKevin Marois16-Nov-17 10:49 
GeneralRe: Active Directory Questions Pin
Mycroft Holmes16-Nov-17 11:36
professionalMycroft Holmes16-Nov-17 11:36 
AnswerRe: Active Directory Questions Pin
BillWoodruff16-Nov-17 20:44
professionalBillWoodruff16-Nov-17 20:44 
GeneralRe: Active Directory Questions Pin
Richard MacCutchan16-Nov-17 22:54
mveRichard MacCutchan16-Nov-17 22:54 
GeneralRe: Active Directory Questions Pin
Kevin Marois17-Nov-17 4:39
professionalKevin Marois17-Nov-17 4:39 
AnswerRe: Active Directory Questions Pin
Nathan Minier17-Nov-17 1:36
professionalNathan Minier17-Nov-17 1:36 
Generalsession Pin
Ishi Kaushik16-Nov-17 7:04
Ishi Kaushik16-Nov-17 7:04 
AnswerRe: Hello , I am working on three tier architecture based project, i am stuck in writting session code. so please tell me how and where i can write the session code Pin
OriginalGriff16-Nov-17 8:03
mveOriginalGriff16-Nov-17 8:03 
QuestionData type mismatch in criteria expression." in c# Pin
sai.201216-Nov-17 5:54
sai.201216-Nov-17 5:54 

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.