what's required to work with the obj.executenonquery command in order to write to an access database.
I've included
Imports System.Data.OleDb
at the top of the form.
Also I've created a dbase connection, which I opened. I'm attepting to use the submit button to execute the executenonquery command.
Below is the code.
I've included
Imports System.Data.OleDb
at the top of the form.
Also I've created a dbase connection, which I opened. I'm attepting to use the submit button to execute the executenonquery command.
Below is the code.
VB.NET:
Imports System.Data.OleDb
Public Class frmCrewChief
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
{...}
#End Region
Private Sub FrmCrewChief_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) HandlesMyBase.Load
btnSave.Enabled = False
End Sub
Private Sub btnEnter_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnEnter.Click
' transferring entries to Que from Form Fields
lblCheck.Text = "Please check your entries, then submit."
lblDisEmp.Text = txtEmp.Text
lblDisDate.Text = dteTimePkr.Text
lblDisCCLast.Text = txtCCLast.Text
lblDisCCFirst2.Text = txtCCFirst.Text
lblDisAMT1Last.Text = txtAmtLast1.Text
lblDisAMT2Last.Text = txtAmtLast2.Text
lblDisAMT3Last.Text = txtAmtLast3.Text
lblDisAMT1First.Text = txtAmtFirst1.Text
lblDisAMT2First.Text = txtAmtFirst2.Text
lblDisAMT3First.Text = txtAmtFirst3.Text
lblDisQtyAmts.Text = cmbNumAmts.Text
lblDisAcft.Text = txtAcft.Text
lblDisTerm.Text = cmbTerm.Text
lblDisGate.Text = txtGate.Text
lblDisScratch.Text = txtScratch.Text
btnSave.Enabled = True
btnEnter.Enabled = False
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSave.Click
' create dbase connection
oleDbConnection.Open()
objChkSubmit.ExecuteNonQuery()
oleDbConnection.Close()
End Sub
End Class
Last edited by a moderator: