𝚂𝚝𝚊𝚙𝚕𝚎𝚜
𝚂𝚝𝚊𝚙𝚕𝚎𝚜
CC#
Created by 𝚂𝚝𝚊𝚙𝚕𝚎𝚜 on 11/12/2023 in #help
+1 value to database item via OleDB?
I'm sorry for the question cause I havent been around database works that much but isnt OleDB and SQL different things? if so does the method above still work?
5 replies
CC#
Created by 𝚂𝚝𝚊𝚙𝚕𝚎𝚜 on 10/11/2023 in #help
❔ Database to Combo Box linking without using SQL??
private void FORMNAME_Load(object sender, EventArgs e)
{
try
{
connection.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connection;
string query = "select * from DATATABLE";
command.CommandText = query;

OleDbDataReader reader = command.ExecuteReader();
while (reader.Read())
{
COMBOBOXNAME.Items.Add(reader["DATAFIELD"]);
}

connection.Close();
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex);
}
}
}
private void FORMNAME_Load(object sender, EventArgs e)
{
try
{
connection.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connection;
string query = "select * from DATATABLE";
command.CommandText = query;

OleDbDataReader reader = command.ExecuteReader();
while (reader.Read())
{
COMBOBOXNAME.Items.Add(reader["DATAFIELD"]);
}

connection.Close();
}
catch (Exception ex)
{
MessageBox.Show("Error " + ex);
}
}
}
6 replies
CC#
Created by 𝚂𝚝𝚊𝚙𝚕𝚎𝚜 on 10/11/2023 in #help
❔ Database to Combo Box linking without using SQL??
Update: I managed to find a solution by playing around with OleDb data reader and stuff, here's what I did
6 replies
CC#
Created by 𝚂𝚝𝚊𝚙𝚕𝚎𝚜 on 10/10/2023 in #help
❔ ComboBox event help
Ah, I reconsidered and I'm just gonna do that instead
13 replies
CC#
Created by 𝚂𝚝𝚊𝚙𝚕𝚎𝚜 on 10/10/2023 in #help
❔ ComboBox event help
I'm using .NET framework, the code aside from the keypresses and unrelated buttons is yet to be added but I'm looking to achieve this specific task for this form to be functional. the combo box for the number is called cboxCandidateNum and the rest is cboxCandidate1, cboxCandidate2, etc.
13 replies