|
-
Aug 8th, 2012, 01:23 PM
#1
Thread Starter
Junior Member
updating textbox from database when using multiple instances of application

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()
-
Aug 9th, 2012, 11:18 AM
#2
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|