Okay so, i'm currently trying to read some data from my access database file, to convert it to an int and then use it for an IF statement, but right now if i try to load it i get a "no data in row/column" error, and im not quite sure why.
[/FONT]
C#:
[/COLOR][COLOR=#333333]int Niv = 0;[/COLOR]
try
{
conn.Open();
OleDbDataReader reader = null;
OleDbCommand cmd = new OleDbCommand("Select Niveau From Tabel1 where ID=" + txt_userID.Text + "", conn);
reader = cmd.ExecuteReader();
Niv = Convert.ToInt32(reader["Niveau"].ToString());
conn.Close();
MessageBox.Show(Niv.ToString());
}
catch(Exception ex)
[FONT=Verdana] { MessageBox.Show(ex.Message); }[/FONT][FONT=Verdana]