I can't find a basic error and would need some help finding it. Error comes when in my form load I am trying to display information in my textbox from my database.
- I use the connection everywhere else so it's not the problem
- I tried another Select statement with another table, still the same error.
what am I missing?
error is Object instance not set to reference
I know that password shouldnt be stored in a table, I am just playing around
clsDataSource.mycon = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\carole\Desktop\CollegeLasalleFall2016\ProgrammationEvenementielle\RealEstate\RealEstate.mdb");
clsDataSource.mycon.Open();
DataSet myset = new DataSet();
int current = 0;
OleDbCommand mycmd = new OleDbCommand("SELECT UserID, email, pwd, FirstName, LastName, BoolAgent, BoolAdmin FROM Users WHERE (BoolAgent = 1)", clsDataSource.mycon);
OleDbDataAdapter myadapt = new OleDbDataAdapter(mycmd);
myadapt.Fill(myset, "AllAgents");
DataTable tbUser = myset.Tables["Users"];
//fill the textbox
txtFirstName.Text = tbUser.Rows[current]["FirstName"].ToString();