Eric Wright
New member
I am trying to add a new row to an Access Table, using ASP.NET (c#).
The following code builds and runs fine, but when I open the table, I see that nothing has changed??
protected void Button3_Click(object sender, EventArgs e)
{
DataView newUserTable = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);
newUserTable.AllowNew = true;
DataRowView rowView = newUserTable.AddNew();
// Change values in the DataRow.
rowView["usernames"] = "New value";
rowView.EndEdit();
newUserTable.ToTable();
}
The following code builds and runs fine, but when I open the table, I see that nothing has changed??
protected void Button3_Click(object sender, EventArgs e)
{
DataView newUserTable = (DataView)AccessDataSource2.Select(DataSourceSelectArguments.Empty);
newUserTable.AllowNew = true;
DataRowView rowView = newUserTable.AddNew();
// Change values in the DataRow.
rowView["usernames"] = "New value";
rowView.EndEdit();
newUserTable.ToTable();
}