I'm trying to polish up an old program I made a few months ago, its essentially a social networking app. As such I'm trying to "write" a new row into one of my tables in Microsoft Access (2010). Before, that was working fine, it was updating as needed/the button pressed. But now, its not.
When I press "Post" it goes through all the lines in the code without issue/error, however the database is not updated. I can't figure out why its not updating, so any assistance is greatly appreciated;
private void btnPost_Click(object sender, EventArgs e)
{
String postText = txtPost.Text;
String followingIDStr = cboxFollowing.ValueMember.ToString();
int followingID = Convert.ToInt32(followingIDStr);
con = new OleDbConnection(connectionString);
DataSet ds = new DataSet();
DataRow dRow;
String sql = "SELECT * FROM Post;";
OleDbDataAdapter da = new OleDbDataAdapter(sql, con);
con.Open();
OleDbCommandBuilder cb = new OleDbCommandBuilder(da);
DataTable dataTable = new DataTable();
da.Fill(ds, "Post");
dRow = ds.Tables["Post"].NewRow();
dRow[1] = memberID;
dRow[2] = followingID;
dRow[3] = "Text";
dRow[4] = postText;
dRow[5] = DateTime.Today.Date.ToString();
dRow[6] = DateTime.Now.ToString("HH:mm");
dRow[7] = DateTime.Now.ToString("dd/MM/yy HH:mm:ss");
ds.Tables["Post"].Rows.Add(dRow);
cb.DataAdapter.Update(ds.Tables["Post"]);
frmNewsFeed newsFeed = new frmNewsFeed();
newsFeed.memberID = memberID;
this.Close();
newsFeed.Show();
}