问题描述
公共类访问Karyawan
公共函数访问KaryawanInsert(ByVal Nik As String,_
ByVal名字作为字符串,_
作为字符串的ByVal Jabatan,作为字符串的ByVal Alamat,_
ByVal Telepon As String)
将myCmd设置为新的OleDbCommand
将myconnection调暗为新的AccessData.DataBaseConnection
myCmd.CommandText =将其插入[Karyawan]" _
& (NIK,FirstName,Jabatan,Alamat,Telepon)值("_
& "&尼克& ","&名& ","&贾巴丹& ""_
& ,"和阿拉马特& ","&电话和电话");"
myCmd.Connection = myconnection.open
myCmd.ExecuteNonQuery()
myconnection.close()
最终功能
End Class
Public Class AccessKaryawan
Public Function AccessKaryawanInsert(ByVal Nik As String, _
ByVal FirstName As String, _
ByVal Jabatan As String, ByVal Alamat As String, _
ByVal Telepon As String)
Dim myCmd As New OleDbCommand
Dim myconnection As New AccessData.DataBaseConnection
myCmd.CommandText = "Insert Into [Karyawan]" _
& " (NIK,FirstName,Jabatan,Alamat,Telepon) Values (" _
& "''" & Nik & "'', ''" & FirstName & "'',''" & Jabatan & "''" _
& ", ''" & Alamat & "'', ''" & Telepon & "'') ;"
myCmd.Connection = myconnection.open
myCmd.ExecuteNonQuery()
myconnection.close()
End Function
End Class
推荐答案
这篇关于我的"AccessKaryawanInsert"收到警告功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!