任何人都可以帮助我,我有一个表格,我通过它在我的 ms 访问数据库中保存日期。有时我单击保存按钮数据正确保存但有时它给我错误“溢出”'ExecuteNonQuery'未声明。由于其保护级别,它可能无法访问。 我正在使用这段代码:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If MsgBox("Are you sure you want to Add Data?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "WARNING") = MsgBoxResult.Yes Then
Dim OleDBC As New OleDbCommand
With OleDBC
.Connection = conn
.CommandText = "Insert Into tblmaritlistBA_I (form_number,name_of_candidate,fathers_name,mothers_name,category,minority,date_of_birth,gender,mobile,address,board,passed_year,intermediate_marks_obtained,intermediate_total_marks,percentage,normalization_factor,total_percentage) VALUES ('" & txtformnumber.Text & "','" & txtstuname.Text & "','" & txtfathname.Text & "','" & txtmothname.Text & "','" & cmbcategory.Text & "','" & cmbminority.Text & "','" & dobPicker1.Text & "','" & cmbgender.Text & "','" & txtmobile.Text & "','" & txtaddress.Text & "','" & cmbboard.Text & "','" & cmbpassedyear.Text & "','" & txtintermarks.Text & "','" & txtintertotalmarks.Text & "','" & txtpercentage.Text & "','" & Lblnormalization.Text & "','" & txtpercentageafterN.Text & "')"
.ExecuteNonQuery()
End With
MsgBox("Data Added!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
Me.Hide()
Call initgrid()
End If
End Sub
请帮助我(“_”)