Can't add a new row to a database

  • Thread starter Thread starter walt
  • Start date Start date
W

walt

Why won't this code add a row to my database? It runs as expected but
when I look in the SQL database using SQL Server Management Studio the
table is empty.

DataRow newRow =
this.dsHealthClub.NotInHouse.NewRow();
newRow["Name"] =
dsEmployees.Employees.Rows[0].ItemArray.GetValue(0);
newRow["DateOut"] = DateTime.Now;
newRow["Comments"] = "";
newRow["Badge"] = visitorID;
this.dsHealthClub.NotInHouse.Rows.Add(newRow);
 
walt,

This code appears to add a new row to a datatable.

I don't see any code here to add the new row to a table within a database.

Kerry Moorman
 
Back
Top