Results 1 to 2 of 2

Thread: updating textbox from database when using multiple instances of application

  1. #1
    Junior Member
    Join Date
    Jul 12
    Posts
    22

    updating textbox from database when using multiple instances of application

    Name:  scrnshot.JPG
Views: 57
Size:  70.8 KB

    Greetings,

    I am having some issues getting my changes to "User Notes" and "Resolution Notes" save/update.
    Currently they will save/update on the current users instance of the app with no problem.
    But they do not/will not show up on the others after changes/saves are made.

    I use the tick event to update my datagridview when rows are added/removed and it works.

    I have tried using sql insert, update... and using refresh/ adapter fill type code... so far nothing.

    Any suggestions on not only the logic (like where to call the code, ie upon double click/update button, upon the form load etc.)

    I can paste sections of code to be looked at just not sure if i'm trying to handle it the right way....

    here is one:
    Code:
    Sub updatenotes()
    
            Dim sqlupdate As String
            sqlupdate = "UPDATE Ticket SET UserNotes=@UserNotes, ResolutionNotes=@ResolutionNotes WHERE TicketID='" & UpdateRecord.txtTicketNumber.Text & "'"
            Dim cmd As New OleDbCommand(sqlupdate, con1)
            ' This assigns the values for our columns in the DataBase. 
            ' To ensure the correct values are written to the correct column
           
            cmd.Parameters.Add(New OleDbParameter("@UserNotes", UpdateRecord.txtUserNotes.Text))
            cmd.Parameters.Add(New OleDbParameter("@ResolutionNotes", UpdateRecord.txtResolutionNotes.Text))
    
            
            con1.Open()
            cmd.ExecuteNonQuery()
            con1.Close()

  2. #2
    Junior Member
    Join Date
    Jul 12
    Posts
    22

    Re: updating textbox from database when using multiple instances of application

    UPDATE:

    I think I can accomplish this by comparing the value in the datagridview against the value in the datatable....

    something like
    Code:
    if Main.dgv1.CurrentRow.Cells(9).Value <> corresponding value in datatable then
                           refresh
    how would i reference an item in the datatable which would be variable to which row i clicked on....

    just having issues on referencing the corresponding value.... as the datagridview is variable based on current row, and the datatable would be the same....

    any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •