string sSql = "delete from Vacation where EmployeeID = ?"; using (OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Feras\Documents\Visual Studio 2008\Projects\Manshiah\Manshiah\MansheyaDB_be.mdb")) { connection.Open(); OleDbCommand command = new OleDbCommand(sSql, connection); command.Parameters.AddWithValue("?", Convert.ToInt32(txtEmployeeId.Text)); OleDbDataReader myReader = command.ExecuteReader(); try { while (myReader.Read()) { Console.WriteLine(myReader.GetInt32(0) + ", " + myReader.GetString(1)); } } finally { // always call Close when done reading. myReader.Close(); connection.Close(); }
OleDbDataReader myReader = command.ExecuteReader();
int numDeleted = command.ExecuteNonQuery();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)