Can't add a new row to a database

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);
 
K

Kerry Moorman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top