Using insert and update commands I update an access database immediately, but do not update the dataset in memory. How do I do this?
I don't think dropping the connection removes the dataset from memory?
I would have though that
dbsupport.update(dssupport, "SupportCall") would do...
I am passing a variable from one one to the another e.g.
Public Sub mysub(ByVal number As Integer)
cmdsupport = dbconn.CreateCommand
cmdsupport.CommandText = "select * from supportcall where ID = '" & number & "'"
dbsupport.Fill(dssupport, "SupportCall")
However...
strSQL = "INSERT INTO tblHistory (catno, wo, cust_name)" & " VALUES ('" & part & "','" & work & "','" & cust &"')"
If part is the name of the text field it should be part.text, work.text and cust.text
Ta works fine, but I am struggling to read the relevant use the private detail_load procedure to automatically populate the relevant text boxes.
But
In the main form:-
Public Sub btndetail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndetail.Click
Dim...
I am relatively new to VB.Net and to be honest modern programming in general (long gone are the days of Turbo Pascal) and I need some help with classes.
I want to pass a variable from one form, so that it can be used as part of connection string in a new form.
I have a button that I wish to...
I want to use a string builder rather than creating the massive string as below.
sqlscript = "INSERT INTO Supportcall(ID,Contact,Description,Status,operator,customer,[date],rework,source,module)" & " VALUES('" & txtcallnumber.Text & "','" & txtcallcontact.Text &...
I use an insert script to update data in an access database and I can see the record has been amended by view the raw data.
However, unless I shut down my application and restart it the data in memory is not updated.
How do I commit the changes to memory as well as the database?
Having dug around, using the 'Handles cmbstatus.dropdown' for a combo box sub, I can do what I need it do
Private Sub cmbstatus_focus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbstatus.DropDown
statusadapter.Fill(Statusds, "Callstatus")
End Sub
Further to the above I now know what my issue is.
When I am navigating through records, the combo box is correctly populated with data from the record.
However, I need to allow the user to change the setting in the combo box upon edit.
When I fill the combo box with the setting options, it...
I have programmatically created a new grid style, but can not seem to get the datagrid to use it. What am I diong wrong?
Dim ts As New DataGridTableStyle()
Dim cs As DataGridColumnStyle
cs = New DataGridTextBoxColumn()
cs.Width = 20
cs.MappingName =...
I have just realised what I have stupidly done. In the form load procedure, I was asking it to fill the combo box AND be populated with the data from the record! Thanks anyway.
Behing the form load sub,I populate some text and combo boxes with data:-
cmbstatus.DataBindings.Add("Text", dssupport.Tables("Supportcall"), "Status")
txtoperator.DataBindings.Add("Text", dssupport.Tables("Supportcall"), "Operator")...
I see it is possible to set which sub a form calls when the escape button is pressed, but is the same feature available if the user hits the form exit controller e.g. the x in the top right corner?
If it isn't, how can acheive it in code?
Why does this code never quit the application?
Dim result As DialogResult
MsgBox("Are you sure you wish to quit the application?", MsgBoxStyle.YesNo)
If result = DialogResult.Yes Then
End
Else
Exit Sub
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.