I'm making this program which tells me the antonym of inserted word. Basically, I have a textBox and a button. Text from textbox is being searched for a match from database and i want to return the column next to it, containing the antonym of a given word. Here's the code:
private void btnFind_Click(object sender, EventArgs e)
{
OleDbCommand command1 = new OleDbCommand();
command1.Connection = connection;
command1.CommandText = "select * from antonymsdb where '" + txtWord.Text + "' = word";
OleDbDataReader reader = command1.ExecuteReader();
int count = 0;
while (reader.Read())
{
count++;
}
if (count == 1)
{
//word has been found and i want to take the word from the column next to this one and put it in a variable
}
}
word is a column of the antonymsdb database from Access.