Re: URGENT : PB Delete Row in Northwind.mdb

From: Val Mazur (group51a_at_hotmail.com)
Date: 03/27/04

  • Next message: pvictor: "Connection to Access DB problem when moving from NT Server to Server2003"
    Date: Fri, 26 Mar 2004 23:44:01 -0500
    
    

    Hi,

    Did you check if record deleted after 5 seconds delay? Jet caches changes in
    a local memory for 5 seconds and you will not always get latest result from
    the database

    -- 
    Val Mazur
    Microsoft MVP
    "ptreves" <ptreves@sympatico.ca> wrote in message 
    news:DDDC7BC4-1194-4BD9-9D6F-3DD49549BA91@microsoft.com...
    > Hello,
    >
    > I am writing as ASP.NET application using a DataGrid Web COntrol.
    > I included a Delete, Edit/Update/Cancel, Select button columns to my 
    > DataGrid.
    >
    > When I click the Delete button, I trap the event.
    > My code however does not delete the selected row.
    >
    > Here is my sample Delete function :
    > -----
    > private void deleteRow(object source, 
    > System.Web.UI.WebControls.DataGridCommandEventArgs e)
    > {
    > try
    > {
    > ErrorMessage.Text = "";
    > OleDbCommand delCommand = new OleDbCommand();
    > delCommand.Connection = oleDbConnection1;
    > delCommand.CommandText = "DELETE FROM Customers " +
    > "WHERE CutomerID = '" + e.Item.Cells[9].Text + "'";
    > delCommand.CommandType = CommandType.Text;
    > oleDbConnection1.Open();
    > delCommand.ExecuteNonQuery();
    > oleDbDataAdapter1.Fill(dataSet11);
    > Cache["CustomerData"] = dataSet11;
    > bindGrid();
    > oleDbConnection1.Close();
    > }
    > catch (Exception ex)
    > {
    > ErrorMessage.Text = ex.Message;
    > }
    > }
    > -----
    >
    > Any feedback is appreciated,
    >
    > Regards,
    >
    > Paolo
    >
    > 
    

  • Next message: pvictor: "Connection to Access DB problem when moving from NT Server to Server2003"