Updating Access 2000 mdb with asp.net vb Microsoft.Jet.OLEDB.4.0

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

jason_at_cyberpine.com
Date: 02/11/05

  • Next message: Kovalenko Dmitry: "Re: How to detect a connection failure in an Execute?"
    Date: 11 Feb 2005 02:00:40 -0800
    
    

    I am able to add and delete records, but the below update does nothing
    and produces no error message either. display look fine. Thanks for any
    help or information.

     Public Sub UserGrid_Update (Source As Object, E As
    DataGridCommandEventArgs)
           Dim objConn as new
    OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=x.mdb")
           Dim cmd As OleDbCommand = new OleDbCommand ("UPDATE tbl SET
    responsible=@responsible,status=@status,waitingon=@waitingon,comments=@comments
    WHERE chain=@chain", objConn)

           Dim schain As String = e.Item.Cells(2).Text
           Dim sresponsible As String = CType(e.Item.Cells(3).Controls (0),
    TextBox).Text
            Dim sstatus As String = CType(e.Item.Cells(4).Controls (0),
    TextBox).Text
            Dim swaitingon As String = CType(e.Item.Cells(5).Controls (0),
    TextBox).Text
            Dim scomments As String = CType(e.Item.Cells(6).Controls (0),
    TextBox).Text

    response.write(schain+"-"+sresponsible+"-"+sstatus+"-"+swaitingon+"-"+scomments)

           cmd.Parameters.Add(new OleDbParameter("@chain", schain))
           cmd.Parameters.Add(new OleDbParameter("@responsible",
    sresponsible))
           cmd.Parameters.Add(new OleDbParameter("@status", sstatus))
           cmd.Parameters.Add(new OleDbParameter("@waitingon", swaitingon))

           cmd.Parameters.Add(new OleDbParameter("@comments", scomments))

     Try

           objConn.Open()
           cmd.ExecuteNonQuery()
           objConn.Close

     Catch ex As Exception
       response.write(ex.Message & ex.stacktrace)
     End Try

    Is there something i needed to set on the DB?


  • Next message: Kovalenko Dmitry: "Re: How to detect a connection failure in an Execute?"

    Relevant Pages

    • Re: Cannot display throw new exception error message
      ... you can't see your error message, because your code doesn't reach the ... line where you throw your Exception. ... To display your custom message, your openFilemethod should look like: ... If you would have had a look at the FileReader API documentation, ...
      (comp.lang.java.programmer)
    • Should throw exception when validating data?
      ... i'm wondering if it is preferred practice to throw exception in this ... should try to never throw an exception in circumstances where you can do ... with the error message so that it can then be accessed in the UI to display ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Displaying error messages
      ... > I'm new to .NET and web development so please forgive. ... > to display an error message, ... I want to inform the user that I just caught this exception. ...
      (microsoft.public.dotnet.general)
    • Displaying error messages
      ... I'm new to .NET and web development so please forgive. ... to display an error message, ... I want to inform the user that I just caught this exception. ...
      (microsoft.public.dotnet.general)
    • Re: asynchronous delegates and events question
      ... which the UI is to display. ... directly from the background thread, ... I've read that if an exception ... > public InitializeComponentDelegate initializeComponent = new ...
      (microsoft.public.dotnet.languages.csharp)