| | |
update record from vb.net2003 to Ms access 2003
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 2
Reputation:
Solved Threads: 0
Can anyone help my code for updating is given an error that “no value given for one or more required parameter".
my code is below
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer
a = period.Text
If period.Text >= 0 Then
period.Text = period.Text - 1
OleDbConnection1.Open()
OleDbDataAdapter1.UpdateCommand.Connection = OleDbConnection1
OleDbDataAdapter1.UpdateCommand.CommandText = "Update ok set nastaff = '" & nastaff.Text & "' , period = '" & period.Text & _
"', amount = '" & amount.Text & "', groupid = " & txtid.SelectionLength + 1 & " where Period = '" & TmpNumber & "'"
'GroupCmbo.Hide()
Try
OleDbDataAdapter1.UpdateCommand.ExecuteNonQuery()
DataSet11.Clear()
OleDbDataAdapter1.Fill(DataSet11, "ok")
Catch Ex As Exception
MsgBox(Ex.Message)
End Try
OleDbConnection1.Close()
nastaff.ReadOnly = True
amount.ReadOnly = True
loan.ReadOnly = True
period.ReadOnly = True
'UpdateBtn.Enabled = False
'UpdateBtn.Enabled = True
TmpNumber = period.Text
nastaff.Focus()
Else
TextBox1.Text = 1
End If
End Sub
my code is below
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer
a = period.Text
If period.Text >= 0 Then
period.Text = period.Text - 1
OleDbConnection1.Open()
OleDbDataAdapter1.UpdateCommand.Connection = OleDbConnection1
OleDbDataAdapter1.UpdateCommand.CommandText = "Update ok set nastaff = '" & nastaff.Text & "' , period = '" & period.Text & _
"', amount = '" & amount.Text & "', groupid = " & txtid.SelectionLength + 1 & " where Period = '" & TmpNumber & "'"
'GroupCmbo.Hide()
Try
OleDbDataAdapter1.UpdateCommand.ExecuteNonQuery()
DataSet11.Clear()
OleDbDataAdapter1.Fill(DataSet11, "ok")
Catch Ex As Exception
MsgBox(Ex.Message)
End Try
OleDbConnection1.Close()
nastaff.ReadOnly = True
amount.ReadOnly = True
loan.ReadOnly = True
period.ReadOnly = True
'UpdateBtn.Enabled = False
'UpdateBtn.Enabled = True
TmpNumber = period.Text
nastaff.Focus()
Else
TextBox1.Text = 1
End If
End Sub
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: problem in inserting records
- Next Thread: loading content of text file into a listbox
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic binary bing button buttons center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist excel file-dialog firewall folder ftp google hardcopy image images insert isnumericfuntioncall listview login math memory mobile ms navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port print problemwithinstallation project reports" save savedialog searchbox serial soap sorting string table tcp temp text textbox timer toolbox trim update updown upload useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





