none
acces database row delete RRS feed

  • Question

  • The following command deletes the rows that contain "13856" in the corresponding rows in the Access database.
     
    I want the rows containing "13856" to remain and the others rows to be deleted. So I want the exact opposite of what you did with the code below. please help me.
     
     
    using (var myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + patch))
    using (var myCommand = myConnection.CreateCommand())
    {
    var nameParam = new OleDbParameter("@k", "13856";
    myCommand.CommandText = "DELETE FROM [bill] WHERE (k) = @k";
    myCommand.Parameters.Add(nameParam);
    myConnection.Open();
    myCommand.ExecuteNonQuery();
    }


    Tuesday, December 19, 2017 8:49 PM

All replies

  • DELETE FROM [bill] WHERE NOT [k] = @k


    Sorunuzun yanıtı bu ise "Yanıt olarak işaretle"yerek siz de forumun işleyişine katkıda bulununuz...

    Tuesday, December 19, 2017 9:42 PM