because declared
cn so you should write
cn.open()
write this...
try
{
cn.Open();
str = "select *from DatabaseLogin where user_id='" + textBox2.Text + "'";
com = new OleDbCommand(str, cn);
OleDbDataReader reader = com.ExecuteReader();
while (reader.Read())
{
checkedListBox1.Items.Add(reader["stckdemge"]);
}
}
catch (Exception ex)
{
MessageBox.Show(" " + ex);
}
Happy Coding!
:)